How to Open All Subrows programmatically

I have a grid of items for sale with detailed descriptions in a sub-row. I would like to provide a button allowing the user to open all the sub-rows at once. This will enable them to print out the entire list with the details.

I am having trouble figuring this out. I was hoping that <a href="#" onClick="function(){ mygrid.cells().open; }">Expand all rows</a> would work. I would like to loop through all the rows in the table, but not sure how to do that.

Could someone please help me?

I would like to loop through all the rows in the table, but not sure how to do that.

mygrid.foreEachRow(function(id){ var cell=mygrid.cellById(id,0);//assume 1st column has "sub_row" type cell.open();//open sub row });

Thanks, that helped a lot! :smiley: For others, the final code for opening and closing all sub-rows:

[code]

Expand all rows
Collapse all rows
[/code]