Commit 3d54826b7a37acd7e66a6c511370b5dbf6bed8fd

Authored by Edmar Moretti
1 parent df844855

Inclusão dos nomes das colunas na função de vinculação entre tabelas

Showing 1 changed file with 9 additions and 5 deletions   Show diff stats
ferramentas/tabela/index.js
@@ -411,7 +411,8 @@ i3GEOF.tabela = { @@ -411,7 +411,8 @@ i3GEOF.tabela = {
411 onde = $i("selecao_"+idtabela), 411 onde = $i("selecao_"+idtabela),
412 ntab = i3GEO.vincularTabelas.janelas.length, 412 ntab = i3GEO.vincularTabelas.janelas.length,
413 valorcel="",i,temp,n,tabtempid,c,tabcomp,linhas,j,valor; 413 valorcel="",i,temp,n,tabtempid,c,tabcomp,linhas,j,valor;
414 - if(onde.firstChild){ 414 + n = onde.childNodes.length;
  415 + for(i=0;i<n;i++){
415 onde.removeChild(onde.firstChild); 416 onde.removeChild(onde.firstChild);
416 } 417 }
417 //verifica se a coluna foi escolhida 418 //verifica se a coluna foi escolhida
@@ -419,7 +420,7 @@ i3GEOF.tabela = { @@ -419,7 +420,7 @@ i3GEOF.tabela = {
419 i3GEO.janela.tempoMsg($trad(39,i3GEOF.tabela.dicionario)); 420 i3GEO.janela.tempoMsg($trad(39,i3GEOF.tabela.dicionario));
420 } 421 }
421 else{ 422 else{
422 - onde.appendChild(v); 423 + //onde.appendChild(v);
423 $i(idtabela+"_corpo").scrollTop = 0; 424 $i(idtabela+"_corpo").scrollTop = 0;
424 //pega o valor da celula escolhida 425 //pega o valor da celula escolhida
425 temp = v.getElementsByTagName("td"); 426 temp = v.getElementsByTagName("td");
@@ -440,11 +441,15 @@ i3GEOF.tabela = { @@ -440,11 +441,15 @@ i3GEOF.tabela = {
440 tabcomp = $i(tabtempid+"_corpo").getElementsByTagName("table")[1]; 441 tabcomp = $i(tabtempid+"_corpo").getElementsByTagName("table")[1];
441 //remove o conteudo do lugar onde o resultado sera mostrado 442 //remove o conteudo do lugar onde o resultado sera mostrado
442 temp = $i(tabtempid+"_corpo").getElementsByTagName("table")[0]; 443 temp = $i(tabtempid+"_corpo").getElementsByTagName("table")[0];
443 - if(temp.firstChild){  
444 - temp.removeChild(temp.firstChild); 444 + n = temp.childNodes.length;
  445 + for(i=0;i<n;i++){
  446 + temp.removeChild(onde.firstChild);
445 } 447 }
446 //linhas da tabela 448 //linhas da tabela
447 linhas = tabcomp.getElementsByTagName("tr"); 449 linhas = tabcomp.getElementsByTagName("tr");
  450 + //insere o cabecalho
  451 + v = linhas[0].cloneNode(true);
  452 + onde.appendChild(v);
448 n = linhas.length; 453 n = linhas.length;
449 //loop nas linhas 454 //loop nas linhas
450 for(j=0;j<n;j++){ 455 for(j=0;j<n;j++){
@@ -457,7 +462,6 @@ i3GEOF.tabela = { @@ -457,7 +462,6 @@ i3GEOF.tabela = {
457 } 462 }
458 } 463 }
459 } 464 }
460 -  
461 } 465 }
462 466
463 } 467 }