getting an error when running subgrid

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:

  1. The parent grid based on data from crxinputsxml.php runs fine.
  2. The subgrid when based on data from crxexplinesxml.php and run as its own parent grid (instead of as a subgrid) also runs fine.
  3. 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.
  4. 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.
  5. 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.

Still trying to figure out how to fix my problem. In trying to narrow it down, I now see that if I delete the lines:

... ... from the ./common/sub.xml file, then I get the same error that I get when I use my ./xml/crxexplinesxml.php file. So, maybe this is progress? But I don't know what to do with it. I need the data in my subgrid to by dynamic, just like the data in my parent grid is dynamic.

I am still stumped on this and hope somebody can point me in the right direction. To rephrase, I am able to get my subgrid to work if my source of data is a static xml file. However, if I use php to generate my data via mysql from my database, I can use this data in a parent grid but can’t figure out how to use the data in a subgrid. Thanks.