1. #1

    Default Unanswered: Grid with Grouping AND Filters

    Unanswered: Grid with Grouping AND Filters


    Hello,
    I have a grid that works well with filters or the grouping feature, but not both together: whenever I enable grouping, it automatically disables the filters.

    Code:
    Ext.define('frontend.view.ResponseTimeTable', {
         extend: 'frontend.view.Table'
        ,alias: 'widget.responsetimetable'
        ,requires: 'frontend.store.ResponseTimes'
        ,title: 'ResponseTimes'
        ,store: 'ResponseTimes'
    
         /**
         * Initialize the component.
         */
        ,initComponent : function() {
            Ext.apply(this, Ext.apply(this.initialConfig, {
                columns: [{
                        header: 'Comments',
                        flex: 1,
                        dataIndex: 'comments',
                        sortable: true,
                        editor: {
                            xtype: 'textfield'
                        }
                        ,filter: { type: 'string' }
                    },
                ] // eo columns[]
                ,features: [ this.buildGrouper()]
            }));
    
            // init config, that may not be overriden
            Ext.apply(this, Ext.apply(this.initialConfig, this.config));
            this.callParent(arguments);
        }
    });
    this.buildGrouper() is defined in the parent class (of type Ext.grid.Panel):

    Code:
    buildGrouper: function(recordType, hideGroupedHeader) {
        return Ext.create('Ext.grid.feature.Grouping',{
                hideGroupedHeader: hideGroupedHeader || false
                ,groupHeaderTpl: '{header}: {renderedValue} - {rows.length:plural("'+ (recordType || "record") +'")}'
        });
    } // eo buildGrouper()

    Any suggestion greatly appreciated

    PS: using ExtJS 4.1.1a

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,001
    Answers
    666
    Vote Rating
    456
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

Thread Participants: 1