-
11 May 2009 2:30 AM #1
Grid + Row Expander + One Row at a time
Grid + Row Expander + One Row at a time
Hi, I currently creating Grid with row expander, but having difficulty when I want to implement one row at a time....
So, when I click row-1, it expands... then when I click row-2, row-1 will collapses and row-2 expands.
Can anyone provide help or links? (sorry if this thread has been posted before)
Thanks for any helps...
-
11 May 2009 3:09 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
So you want to collapse all rows on expand of one row?
Try something like:
Code:expander.on('beforeexpand', function(expander, record, body, rowIndex){ for(var id in expander.state){ if(expander.state.hasOwnProperty(id) && expander.state[id]){ expander.collapseRow(expander.grid.getStore().indexOfId(id)); } } });
-
11 May 2009 10:15 PM #3
hi! condor...
i have a same problem with mr. brat pidd
i have try your code in my program, but it always error..
this is the error message.
Index or size is negative or greater than the allowed amount" code: "1
http://localhost/zikula/modules/Exam...t-all-debug.js
Line 32252
i try to build nested grid within expander and tab panel.
when i expand the row 0, then i expand the other row, data in the grid always refresh and same each other.
if you have solution for this error, please share to me....
thanks u very much....
-
11 May 2009 10:46 PM #4
-
11 May 2009 10:54 PM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
Well, my code could fail if your store is also filtered or paged.
Try if this helps:
Code:expander.on('beforeexpand', function(expander, record, body, rowIndex){ for(var id in expander.state){ if(expander.state.hasOwnProperty(id) && expander.state[id]){ var index = expander.grid.getStore().indexOfId(id); if(index >= 0){ expander.collapseRow(expander.grid.getStore().indexOfId(id)); } } } });
-
12 May 2009 1:22 AM #6
thanks condor,,
i have a trouble when i build nested grid within rowexpander and tabpanel
follow this link http://extjs.com/forum/showthread.ph...528#post328528
thanks...


Reply With Quote