Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7082 in 4.2.1.883.
  1. #11
    Sencha User
    Join Date
    Feb 2009
    Posts
    5
    Vote Rating
    3
    Steferson Patake is on a distinguished road

      1  

    Default


    i came with a better approach:

    changing the listener from the form panel to the store, like this:
    Code:
    var storeOpcoesAcesso = Ext.create('Ext.data.JsonStore', {
    ...
    groupField: 'descricao',
    listeners: {
      load: function(este, opts) {
        groupingFeature.collapseAll();
      }
    },
    ...
    });
    now its working fine

  2. #12
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    975
    Vote Rating
    110
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Thank you for sharing your findings!

    We all are curious when it will be fixed in ExtJS
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  3. #13
    Sencha User
    Join Date
    Sep 2012
    Posts
    16
    Vote Rating
    2
    expensior is on a distinguished road

      0  

    Default


    These "fixes" do not seem very efficient at all. I mean listening and collapsing after the store has loaded the data seems incredibly inefficient especially in grouping grids with 20-30 groups.

    The only real fix should be that they are initially collapsed when rendered after adding them to the store.

    I really wonder why this was not fixed since it is an old issue.

    In 4.1.1 I used this to fix this problem

    Code:
    grid.getView().on({                 'beforerefresh': function(view,eOpts) { 
                        return false; 
                    },             
                    single: true 
                });
    And similiar to then expand single groups which had its expansion state saved in a session cookie.

    Doesn't work in 4.2 anymore however. Does nothing.

    Maybe someone should report this bug in the 4.2 forum.

  4. #14
    Sencha User
    Join Date
    Jul 2013
    Posts
    1
    Vote Rating
    1
    GustavoVV is on a distinguished road

      1  

    Default Solution for 3.4

    Solution for 3.4


    This worked for me:

    Code:
    new Ext.data.GroupingStore({
    ...
     ,listeners: {
               load: function(este, opts) {
                   groupingView.startCollapsed=true;
               }
     }
    Thanks for the code

  5. #15
    Sencha Premium Member
    Join Date
    Feb 2011
    Location
    Amsterdam
    Posts
    54
    Vote Rating
    -6
    sblommers is infamous around these parts sblommers is infamous around these parts

      -1  

    Default


    Sencha lazy bastards

    Code:
    Ext.override(Ext.grid.feature.GroupStore, {
    	processStore: function(store) {
            var me = this,
                groups = store.getGroups(),
                groupCount = groups.length,
                i,
                group,
                groupPlaceholder,
                data = me.data,
                oldGroupCache = me.groupingFeature.groupCache,
                groupCache = me.groupingFeature.clearGroupCache(),
                collapseAll = me.groupingFeature.startCollapsed;
    
    
            if (data) {
                data.clear();
            } else {
                data = me.data = new Ext.util.MixedCollection(false, Ext.data.Store.recordIdFn);
            }
    
    
            if (store.getCount()) {
    
    
                // Upon first process of a loaded store, clear the "always" collapse" flag
                // DISABLED ONLY THIS =>>> me.groupingFeature.startCollapsed = false;
    
    
                for (i = 0; i < groupCount; i++) {
    
    
                    // group contains eg
                    // { children: [childRec0, childRec1...], name: <group field value for group> }
                    group = groups[i];
    
    
                    // Cache group information by group name
                    groupCache[group.name] = group;
                    group.isCollapsed = collapseAll || (oldGroupCache[group.name] && oldGroupCache[group.name].isCollapsed);
    
    
                    // If group is collapsed, then represent it by one dummy row which is never visible, but which acts
                    // as a start and end group trigger.
                    if (group.isCollapsed) {
                        group.placeholder = groupPlaceholder = new store.model(null, 'group-' + group.name + '-placeholder');
                        groupPlaceholder.set(me.getGroupField(), group.name);
                        groupPlaceholder.rows = groupPlaceholder.children = group.children;
                        groupPlaceholder.isCollapsedPlaceholder = true;
                        data.add(groupPlaceholder);
                    }
    
    
                    // Expanded group - add the group's child records.
                    else {
                        data.insert(me.data.length, group.children);
                    }
                }
            }
        }
    });
    Fix your product, like my 15th override to get your bugs out!@!