Results 1 to 2 of 2

Thread: Ext.grid.GroupingView -> toggleGroup-event

  1. #1
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Vote Rating
    129
      0  

    Default Ext.grid.GroupingView -> toggleGroup-event

    hi together,

    this is just a small but helpful override:

    Code:
        /*
         * 3.0.3 and 3.1.0
         * adding the toggleGroup - event
         */
        Ext.grid.GroupingView.override ({
            toggleGroup : function(group, expanded){
                var gel = Ext.get(group);
                expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed');
                if(this.state[gel.id] !== expanded){
                    this.grid.stopEditing(true);
                    this.state[gel.id] = expanded;
                    gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed');
                    this.fireEvent('toggleGroup', this, gel, expanded);
                }
            }
        });
    whenever you expand / collapse a group of your grid, you can determine the change including the params view, groupEl, expanded.

    if i had access to the feature-requests-forum, i would post it there. feel free to move the topic or integrate it in svn.

    example-usage: if you combine the Ext.ux.grid.RowEditor with a groupingView, you will notice, that the editor does not hide, when you collapse a group. this solves it:

    grid-config
    Code:
            ,view: new Ext.grid.GroupingView({
                 forceFit     : true
                ,markDirty    : false
                ,listeners    : {
                    toggleGroup : function(view, group, expanded){
                        if(!expanded){
                            editor.stopEditing(false);
                        }
                    }
                }
            })
    kind regards,
    tobiu
    Last edited by tobiu; 2 Jan 2010 at 1:00 PM. Reason: typo

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Many thanks)) great work will not be pulling my hair out any more
    It will take not a lot of time but brings great results

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •