Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dimitri Gielis on Feb 02, 2009 03:09
open dhtmlx forum
Expand / Collapse All of sub_row_grid

Hello,

I'm looking into Expanding/Collapsing all fuctionality for a grid like http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/extended_modes/pro_subgrids.html

I load a grid with xml and in the xml I have a call to another url with my sub grid like: <row id="3"><cell type="sub_row_grid"> url </cell>

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

Thanks so much.
Answer posted by Support on Feb 02, 2009 03:31
For single level of subgrids it may look as 

mygrid.forEachRow(function(id){
    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
});