Problem with addRow in treeGrid

Hi there,

I got the following Problem, if I want to add a row to a treeGrid. It ends with a infinite loop of GET-Requests to the loader file with incremented values of the GET parameter “count” and the Error: “TypeError: b.nodeName is undefined dhtmlx.js Line 33” according to Firebug.
Any idea?

Thanks,
Luke :unamused:

Unfortunately the issue cannot be reproduced locally.
Please, provide any kind of sample of your code.

Ok here you go:

[code] function baueMaske() {
anwaltLayout = new dhtmlXLayoutObject(“anwaltLayout”,“2E”);
anwaltLayout.cells(“a”).setText(“Filter”);
anwaltLayout.cells(“b”).setText(“Auswahl”);
anwaltLayout.cells(“a”).setHeight(96);
anwaltMenu = new dhtmlXMenuObject();
anwaltMenu.setIconsPath(“images/icon/”);
anwaltMenu.renderAsContextMenu();
anwaltMenu.attachEvent(“onClick”, onButtonClick);
anwaltMenu.loadXML(tpl_bereich_root+“xml/context.xml”);
anwaltForm = anwaltLayout.cells(“a”).attachForm(formData);
anwaltForm.attachEvent(“onChange”,function(fid,id2){
if(id2 == “dbbanwalt”){
if(hiddendbb == false){
anwaltGrid.forEachRow(function(id){
if(anwaltGrid.cells(id,13).getValue() == 0 && id > 150000000){
anwaltGrid.setRowHidden(id,true);
}
});
hiddendbb = true;
} else {
anwaltGrid.forEachRow(function(id){
if(anwaltGrid.cells(id,13).getValue() == 0 && id > 150000000){
anwaltGrid.setRowHidden(id,false);
}
});
hiddendbb = false;
}

  }
  if(id2 == "klage"){
    if(hiddenklage == false){
    anwaltGrid.forEachRow(function(id){
      if(anwaltGrid.cells(id,14).getValue() == 0 && id > 150000000){
        anwaltGrid.setRowHidden(id,true);
      }      
  });
  hiddenklage = true;
    } else {
    anwaltGrid.forEachRow(function(id){
      if(anwaltGrid.cells(id,14).getValue() == 0 && id > 150000000){
        anwaltGrid.setRowHidden(id,false);
      }      
  });
  hiddenklage = false;      
  }    
  }
});
anwaltGrid = anwaltLayout.cells("b").attachGrid();
anwaltGrid.setImagePath("inc/dhtmlx/imgs/");
anwaltGrid.setHeader("Firma,Straße,PLZ,Ort,Telefon,Telefax,Email,Internet,Anrede,Titel,Vorname,Nachname,Aktiv,DBB-Anwalt,Klage");
anwaltGrid.setInitWidths("200,*,50,*,*,*,*,*,50,50,*,*,*,*,*");
anwaltGrid.setColAlign("left,left,left,left,left,left,left,left,left,left,left,left,middle,middle,middle");
anwaltGrid.setColTypes("tree,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ch,ch,ch");
anwaltGrid.attachHeader("#text_search,#text_search,#text_search,#text_search,#text_search,#text_search,#text_search,#text_search,#text_search,#text_search,#text_search,#text_search,,,");
anwaltGrid.setColumnHidden(13,true);
anwaltGrid.setColumnHidden(14,true);
anwaltGrid.enableAutoWidth(true);
anwaltGrid.enableAutoHeight(true);
anwaltGrid.enableContextMenu(anwaltMenu);
anwaltGrid.loadXML(tpl_bereich_root+"aktion.php");
anwaltGrid.kidsXmlFile = tpl_bereich_root+"aktion.php";
anwaltGrid.init();
anwaltGrid.enableSmartRendering(true);                               

}

function onButtonClick(menuid,type){
var id = anwaltGrid.contextID.split("_");
id = id[0];
console.log(menuid);
if(menuid == “neuerAnwalt”){
anwaltGrid.addRow((new Date()).valueOf(),[‘Firma’,‘Straße’,‘Postleitzahl’,‘Ort’,‘Telefon’,‘Telefax’,‘Email’,‘Internet’,‘Anrede’,‘Titel’,‘Vorname’,‘Nachname’,1,1,1],0);
}
if(id > 150000000){
// kunde
if(menuid == “kndseite”){
window.location.href=“inhalt.php?modul=kunden&bereich=kundenseite&kundeID=”+id;
return true;
}

} else {
  // anwalt
}

} [/code]

Thanks :slight_smile:

Unfortunately the issue cannot be reproduced locally. Your code works well for us.
If issue still occurs for you - please, provide with a complete demo, where the issue can be reconstructed.
Here you can find a tutorial:
docs.dhtmlx.com/doku.php?id=othe … leted_demo