Expand / Collapse All of sub_row_grid


I’m looking into Expanding/Collapsing all fuctionality for a grid like dhtmlx.com/docs/products/dht … grids.html

I load a grid with xml and in the xml I have a call to another url with my sub grid like: url

What javascript should I put behind a button to get the Expand/Collapse all functionality?

Thanks so much.

For single level of subgrids it may look as

var cell = mygrid.cells(id,INDEX); //INDEX - index of columns with subgrids
if (cell.open) cell.open(); //in case of collapse-all - there is a cell.close() method