-
22 Mar 2008 5:16 AM #1
Row Expander - expand 1st row by default
Row Expander - expand 1st row by default
Hi guys & girls
I have a question I hope someone can help with.
I have a grid working fine with paging, the row expander plugin and an expand all button. The last issue I can't fingure out is how to make the first row expanded by default.
After searching the forums I found this post: http://extjs.com/forum/showthread.php?t=24485, but couldn't get it work correctly. I've spent a morning on this and still can't crack it.
Can anyone offer some advice?
Thanks in advance - Deano
-
22 Mar 2008 5:59 AM #2
Try:
Code:myExpander.expandRow(0);
-
22 Mar 2008 6:22 AM #3
Hi Evant
Thanks for replying.
I tried your suggestion with no luck...it throws an error:
It seems to me that the row object is not been returned correctly in the RowExpander.jsPHP Code:row has no properties
var record = this.grid.store.getAt(row.rowIndex);
'row' is still undefined after this statement.PHP Code:if(typeof row == 'number'){
row = this.grid.view.getRow(row);
}
By the way I am calling
right at the end of my script...I presume this is correct?PHP Code:myExpander.expandRow(0);
Deano
-
22 Mar 2008 6:29 AM #4
You should probably do it after the grid is rendered:
If that fails, try it on store load.Code:myGrid.on('render', function() { myExpander.expandRow(0); } );
-
22 Mar 2008 6:40 AM #5
Evant
The load listener on my store cracked it thank you.
Deano
-
3 Jun 2009 9:19 AM #6
How could you run the option to leave the first row grid expanded? You can post the complete example?
Thanks
-
13 Aug 2009 8:12 AM #7
expand/collapse All Rows
expand/collapse All Rows
Code:function expandAllRows() { nRows=store.getCount(); for(i=0;i< nRows;i++) myExpander.expandRow(grid.view.getRow(i)); } function collapseAllRows() { nRows=store.getCount(); for(i=0;i<nRows;i++) myExpander.collapseRow(grid.view.getRow(i)); }


Reply With Quote
