Two issues:
- If the subgrid does not exist and I try to check for it with
var mysubgrid = maingrid.cells(row,0).getSubGrid();
It returns “not an object”. How do I check if the subgrid exists?
Does it matter if I use cells(row,0) vs cellById(row,0)?
- Subgrid exists with rows and I want to add multiple additional rows to it.
I want to overwrite what is in subgrid with all the new rows. So, 2 old rows, 3 new rows, I write all 5 rows to the subgrid.
maingrid.cellById(row,0).setValue(data); Works 99 out of 100 times and NO errors.
Should I be doing something different?
bbyDRgrid.attachEvent(“onSubGridCreated”,function(subgrid,row,col,value){
subgrid.setHeader(“Item Sku,Item Description,UPC,Units,In Process/Applied,DMQRow”);
subgrid.setColTypes(“ro,ro,ro,ron,ro,ro”);
subgrid.setInitWidths(“100,250,100,100,100,0”);
subgrid.setColAlign(“left,center,left,center,center,right”);
subgrid.setColSorting(“str,str,str,ron,str,str”)
subgrid.csv.row = “^”;
subgrid.csv.cell = “|”;
subgrid.init();
subgrid.setColumnHidden(5,true);
subgrid.clearAll();
subgrid.loadCSVString(value);
// subgrid.callEvent(“onGridReconstructed”,[]); Do I need this???
return false; // block default behavior
});
Thanks,
Rich