PDA

View Full Version : How do I programmatically expand/collpase groups in Ext.grid.View?



JKindwall
26 Aug 2011, 11:46 AM
I am currently in the process of updating code used to drive an ExtJs gui during automated tests to work with ExtJs 4.0. When operating on individual rows/cells in a grid, we need to make sure that if the grid being operated on uses grouping, that the group containing the row/cell we want to interact with is expanded. With Ext 3.x we used something like this:



if (grid.view instanceof window.Ext.grid.GroupingView) {
grid.view.expandAllGroups();
}


Now, I'm trying to do the same thing in Ext 4.0, and so far this is what I've got:



if (window.Ext.Array.some(grid.features, function(f) { return f instanceof Ext.grid.feature.Grouping; }, null) {
????
}


Since the GroupingView class no longer exists, I no longer have the expandAllGroups method to call, and I've been unable to find any other way to programmatically expand/collapse groups in an Ext.grid.View either individually or all at once.

skirtle
29 Aug 2011, 3:07 AM
A couple of techniques are described here:

http://www.sencha.com/forum/showthread.php?143617