PDA

View Full Version : Grid + RowExpander: Expand one row at time



andyts93
6 May 2013, 7:09 AM
Hi, I'm using RowExpander plugin and I want to expand one row at time, so when I click on a row all the other must collapse. I read this topic (http://www.sencha.com/forum/showthread.php?68121-Grid-Row-Expander-One-Row-at-a-time) but beforeexpand event doesn't fire
I tried this:


resultGrid.view.on('beforeexpand', function(expander, record, body, rowIndex){
alert("OK");
});

And this:


resultGrid.on('beforeexpand', function(expander, record, body, rowIndex){
alert("OK");
});

droessner
6 May 2013, 9:03 AM
Try



resultGrid.view.on('expandbody', function(rowNode, record, expandRow, eOpts){
alert("OK");
});

andyts93
6 May 2013, 11:02 PM
expandbody works but if I want to collapse all the rows before expand one of them I have to use a sort of beforeexpand?, right?

EDIT:
I found this useful addon (http://www.sencha.com/forum/showthread.php?242602-RowExpander-Addon-expandOnlyOne-to-auto-collapse-the-last-expanded-row)