I get the following error on line 5889 in dhtmlxgrid.js when attempting a subgrid:
this.obj.firstChild is null
My parent grid (inputsGrid) runs fine:
inputsGrid.setIconsPath(“codebase/imgs/”);
inputsGrid.setImagePath(“codebase/imgs/”);
inputsGrid.setHeader (" ,enabled,id,…,user,updated");
inputsGrid.setColumnIds (" ,enabled,id,…,user,updated");
inputsGrid.setInitWidths(“30,50,30,…,30,*”);
inputsGrid.setColAlign (“right,left,left,…,left,left”);
inputsGrid.setColTypes (“sub_row_grid,acheck,ro,…,ro,ro”);
inputsGrid.enableEditEvents(false, true, false);
inputsGrid.setColSorting(“na,na,na,str,str,na,na,na,na,na,na,na”);
inputsGrid.enableMultiline(false);
inputsGrid.init();
inputsGrid.loadXML("./xml/crxinputsxml.php");
var dpinputs = new dataProcessor("./xml/crxinputsxml.php");
dpinputs.init(inputsGrid);
dpinputs.styles = {updated: “font-weight:bold; font-style:italic; color:green;”}
When I click on the plus sign in the first column, the subgrid xml identified in the first field of the data called in ./xml/crxinputsxml.php is correctly found and loaded. However, at that point I get the error mentioned above.
The code for ./xml/crxexplinesxml.php (which is the exact text found in the first field of the inputs table) is:
…
…
if ($gridConn ->is_select_mode())
{$gridConn ->render_sql(“Select * from crxexplines”,“explinesid_exp”,“enabled_exp,crops_exp”);
}
else
{$gridConn ->render_table(“crxexplines”,“explinesid_exp”,“enabled_exp,crops_exp”);
}
…
So, to summarize:
- The parent grid based on data from crxinputsxml.php runs fine.
- The subgrid when based on data from crxexplinesxml.php and run as its own parent grid (instead of as a subgrid) also runs fine.
- As a test, when I change the first field of the inputs table to the dhtmlx data sample xml of ./common/sub.xml instead of using ./xml/crxexplinesxml.php, and thus run the data sample as the subgrid, this runs fine.
- So, I can get the grid for either inputs or explines, and I can get a test subgrid, so apparently most of what I am doing is correct.
- It is only when I try to run the data from crxexplinesxml.php as a subgrid of the inputs grid that I get the error.
Can you tell me what I am doing wrong? Thank you.