Expand and Collapse All subgrids

I have a table where each row has a sub-table. I would like to put a button next to the table to expand and collapse all subgrids. Can this be done?



John

To open one sub grid row you can use:
mygrid.cellByInd(rowId,cellIndex).open();
To open all sub grids you should iterate through all rows:
mygrid.forEachRow(function(id){
mygrid.cellByInd(id,cellIndex).open();
});