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.

You can destroy dhtmlxGrid object with destructor() method:
mygrid.destructor()
dhtmlx.com/dhxdocs/doku.php?id=d … b_row_grid