PDA

View Full Version : RowEditing collapses all groups



wheckewa
11 Sep 2014, 4:09 AM
We use a GridPanel with the GroupingSummary feature and the RowEditing plugin. The GroupingFeature is configured with "startCollapsed: true".

All the groups are closed automatically after editing the data of a row and clicking on the Update button. It would be nice if the expanded groups would still be expanded after the Update.

The collapsedStates are set as they should be for the groups, expanded and collapsed. But the groups are rendered in the collapsed state.

It tried to override the collapse event to stop it from collapsing, but it is not triggered in this case. It is triggered if I collapse the group with collapseAll(), so I think this would be the correct event.

A refresh() on the view of the grid does not correct this issue.

I've added a button to expand the groups again. The .expand(groupName) is called, but it doesn't have any visible effect.


var groups = Ext.data.StoreManager.lookup('oppStore').getGroups();
var groupingFeature = Ext.getCmp('mainGrid').getView().features[0]; //[0] for testing only


var states = Ext.state.Manager.provider.get('GroupStates');
if (states)
{
for (var x = 0; x < groups.length; x++)
{
var groupName = groups[x].name;
var state = states[groupName];


if (state != undefined)
{
expandedByRestoreGroupingStates = true;

if (state)
{
console.log(groupingFeature.collapsedState[groupName]);
console.log("collapsing: " + groupName);
groupingFeature.collapse(groupName);
}
else
{
console.log(groupingFeature.collapsedState[groupName]);
console.log("expanding: " + groupName);
groupingFeature.expand(groupName);
}
}
}
}

Ext JS version: 4.1

Any suggestions?

Gary Schlosberg
17 Sep 2014, 3:44 PM
Sounds like this issue, which was fixed in 4.2.1:
http://www.sencha.com/forum/showthread.php?238728

There seems to be a workaround on that thread which will hopefully help you.

wheckewa
18 Sep 2014, 5:50 AM
Thank you very much!

There was indeed a suitable workaround for this case.