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 411 onde = $i("selecao_"+idtabela),
412 412 ntab = i3GEO.vincularTabelas.janelas.length,
413 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 416 onde.removeChild(onde.firstChild);
416 417 }
417 418 //verifica se a coluna foi escolhida
... ... @@ -419,7 +420,7 @@ i3GEOF.tabela = {
419 420 i3GEO.janela.tempoMsg($trad(39,i3GEOF.tabela.dicionario));
420 421 }
421 422 else{
422   - onde.appendChild(v);
  423 + //onde.appendChild(v);
423 424 $i(idtabela+"_corpo").scrollTop = 0;
424 425 //pega o valor da celula escolhida
425 426 temp = v.getElementsByTagName("td");
... ... @@ -440,11 +441,15 @@ i3GEOF.tabela = {
440 441 tabcomp = $i(tabtempid+"_corpo").getElementsByTagName("table")[1];
441 442 //remove o conteudo do lugar onde o resultado sera mostrado
442 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 448 //linhas da tabela
447 449 linhas = tabcomp.getElementsByTagName("tr");
  450 + //insere o cabecalho
  451 + v = linhas[0].cloneNode(true);
  452 + onde.appendChild(v);
448 453 n = linhas.length;
449 454 //loop nas linhas
450 455 for(j=0;j<n;j++){
... ... @@ -457,7 +462,6 @@ i3GEOF.tabela = {
457 462 }
458 463 }
459 464 }
460   -
461 465 }
462 466  
463 467 }
... ...