Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Shane Kirk on Nov 18, 2009 08:58
open dhtmlx forum
destroy subgrid on row close

I have a grid with multiple subgrids. I have a "Check All" button that marks all rows in a subgrid. I load the subgrid when row is expanded. My problem is, once a subgrid is loaded........ and then that associated row is closed. The "Check All" button is still marking the rows in the subgrid in the row that was closed. I would like to remove the subrow information from the grid object when the row is closed so the rows are not marked by the "Check All" button. I am going at it from this direction.

mygrid.attachEvent("onSubRowOpen",function(id,state){
if(state === false){
kill subgrid and kill associated dataprocessor
} else {
///do nothing
}
return true;
})

Can you guide me any further... or if another method would work better.

Thanks in advance.
Answer posted by dhxSupport on Nov 18, 2009 09:08
You can destroy dhtmlxGrid object with destructor() method:
mygrid.destructor()
http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_destructor
You can get sub grid object linked to the specified row with 
mygrid.cellById(rowId,cellIndex).getSubGrid()
http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid:methods_specific_for_some_excells#sub_row_grid