_childIndexes null or not object - Trying to update grid row

I have a parent child form I am creating.



I send the parent data with the dhtmlxAjax control and return the newly generated row id for the parent record so that I can use this id to relate the child records in a grid.



I am not sure how to include an additional parameter when sending the rows from the child grid (ie, my parent id), so I am attempting to update a hidden column inside the grid before sending the child data via the gridDataProcessor.send() method.



The problem is I sometimes get a “_childIndexes null or not an object”.



Why am I getting this message?



I am not trying to reference any row that is greater than what I have. For example I use the following code. The .getRowsNum() clearly show 10 rows in my grid and I can clearly see ten rows, but when I try to update the second row of grid with my parent id, I get the error message. Any ideas as to what the problem may be? or a better solution?



for (var i=1; i<= oGridEquipment.getRowsNum(); i++)

{

oGridEquipment.cells(i,0).setValue(dirId);

}

In your code , your are mixing row ID and row Indexes, the “var i” store row index, while command which you are using requires row ID
Just change cells to cellByIndex

for (var i=1; i<= oGridEquipment.getRowsNum(); i++)
{
oGridEquipment.cellByIndex(i,0).setValue(dirId);
}