Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:42:23+00:00 2026-06-18T06:42:23+00:00

I’m using Sencha Ext Js 4, and I’ve an Ext.grid.Panel. I would add inside

  • 0

I’m using Sencha Ext Js 4, and I’ve an Ext.grid.Panel.
I would add inside the header another element, for example a textbox. Is it possible?

{filterable: true, header: 'Unique' /*Here i want add a textbox*/,  dataIndex: 'label', flex: 1, sortable: true}

It should look like this imageExample.

EDIT:
This is my customized grid:

  var grid1 = Ext.create('Ext.grid.Panel', {
    store: getLocalStore(),
    enableLocking: true,
    width: 600,
    height: 300,
    plugins: [{
        ptype: 'rowexpander',
        rowBodyTpl : new Ext.XTemplate(
            '<p><b>Company:</b> {company}</p>',
            '<p><b>Change:</b> {change:this.formatChange}</p><br>',
            '<p><b>Summary:</b> {desc}</p>',
        {
            formatChange: function(v){
                var color = v >= 0 ? 'green' : 'red';
                return '<span style="color: ' + color + ';">' + Ext.util.Format.usMoney(v) + '</span>';
            }
        })
    }],
    collapsible: true,
    animCollapse: false,
    title: 'Expander Rows in a Collapsible Grid with lockable columns',
    iconCls: 'icon-grid',
    margin: '0 0 20 0',
    renderTo: Ext.getBody()
    initComponent: function() {

    var filter = Ext.ComponentQuery.query('[ftype="filters"]'); 
    filter.local = false;

    console.log('initComponent function in View has been called...');

    this.columns = [
          {tooltip:'The unque id associated with the current node', 
            hidden: true, header: 'id', width: 45, sortable: false, hideable: true, id: 'id'},
          {tooltip:'Friendly name of current node. This can be edited',
              filterable: true, header: [
                                         'Label',{
                                             text: 'action'}

                                         ],  dataIndex: 'label', flex: 1, sortable: true, 
              editor: {
                  xtype: 'textfield',
                  allowBlank: false
              }
          },
          {filterable: true, header: 'Unique', dataIndex: 'address_unique', flex: 1},
          {filterable: true, header: 'Address network', dataIndex: 'address_network', flex: 1},
          {tooltip:'The current node status', 
            filterable: true, header: 'Node status', dataIndex: 'online', flex: 1},
          {tooltip:'Tells whether this node has been accepted or not.', 
            hidden: true, filterable: true, header: 'Accepted', dataIndex: 'accepted', flex: 1},
          {tooltip:'Type of node: this can be a router, a leaf node, a virtual node',
            hidden: true, filterable: true, header: 'Type', dataIndex: 'type', flex: 1}
    ];
    Ext.getStore('M2MResources').guaranteeRange(0, 200);

    this.callParent(arguments);
  }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:42:25+00:00Added an answer on June 18, 2026 at 6:42 am

    This is the solution i’ve used. Working well with EXTJS 4.1.x:
    Add this plugin (written by D. Zucconi) in the folder:

    Ext\ux\grid\plugin

     /**
     * Plugin that enable filters on the grid header.<br>
     * The header filters are integrated with new Ext4 <code>Ext.data.Store</code> filters.<br>
     * It enables:
     * <ul>
     * <li>Instances of <code>Ext.form.field.Field</code> subclasses that can be used as filter fields into column header</li>
     * <li>New grid methods to control header filters (get values, update, apply)</li>
     * <li>New grid events to intercept plugin and filters events</li>
     * </ul>
     * 
     * The plugins also enables the stateful feature for header filters so filter values are stored with grid status if grid is stateful.<br>
     * 
     * # Enable filters on grid columns
     * The plugin checks the <code>filter</code> attribute that can be included into each column configuration.
     * The value of this attribute can be a <code>Ext.form.field.Field</code> configuration or an array of field configurations to enable more
     * than one filter on a single column.<br>
     * Field <code>readOnly</code> and <code>disabled</code> attributes are managed by the plugin to avoid filter update or filter apply.
     * The filter field configuration also supports some special attributes to control filter configuration:
     * <ul>
     * <li>
     *     <code>filterName</code>: the name of the filter that will be used when the filter is applied to store filters (as <code>property</code> of <code>Ext.util.Filter</code> attribute).
     *     If this attribute is not specified the column <code>dataIndex</code> will be used. <b>NOTE</b>: The filter name must be unique in a grid header. The plugin doesn't support correctly filters
     *     with same name.
     * </li>
     * </ul>
     * On the grid configuration the {@link #headerFilters} attribute is supported. The value must be an object with name-values pairs for filters to initialize. 
     * It can be used to initialize header filters in grid configuration.
     * 
     * # Plugin configuration
     * The plugin supports also some configuration attributes that can be specified when the plugin is created (with <code>Ext.create</code>).
     * These parameters are:
     * <ul>
     * <li>{@link #stateful}: Enables filters save and load when grid status is managed by <code>Ext.state.Manager</code>. If the grid is not stateful this parameter has no effects</li>
     * <li>{@link #reloadOnChange}: Intercepts the special {@link #headerfilterchange} plugin-enabled grid event and automatically reload or refresh grid Store. Default true</li>
     * <li>{@link #ensureFilteredVisible}: If one filter on column is active, the plugin ensures that this column is not hidden (if can be made visible).</li>
     * <li>{@link #enableTooltip}: Enable active filters description tootip on grid header</li>
     * </ul>
     * 
     * # Enabled grid methods
     * <ul>
     *     <li><code>setHeaderFilter(name, value, reset)</code>: Set a single filter value</li>
     *     <li><code>setHeaderFilters(filters, reset)</code>: Set header filters</li>
     *     <li><code>getHeaderFilters()</code>: Set header filters</li>
     *     <li><code>getHeaderFilterField(filterName)</code>: To access filter field</li>
     *     <li><code>resetHeaderFilters()</code>: Resets filter fields calling reset() method of each one</li>
     *     <li><code>clearHeaderFilters()</code>: Clears filter fields</li>
     *     <li><code>applyHeaderFilters()</code>: Applies filters values to Grid Store. The store will be also refreshed or reloaded if {@link #reloadOnChange} is true</li>
     * </ul>
     * 
     * # Enabled grid events
     * <ul>
     *     <li>{@link #headerfilterchange} : fired by Grid when some header filter changes value</li>
     *     <li>{@link #headerfiltersrender} : fired by Grid when header filters are rendered</li>
     *     <li>{@link #beforeheaderfiltersapply} : fired before filters are applied to Grid Store</li>
     *     <li>{@link #headerfiltersapply} : fired after filters are applied to Grid Store</li>
     * </ul>
     * 
     * @author Damiano Zucconi - http://www.isipc.it
     * @version 0.2.0
     */
    Ext.define('Ext.ux.grid.plugin.HeaderFilters',{
    
        ptype: 'gridheaderfilters',
    
        alternateClassName: ['Ext.ux.grid.HeaderFilters', 'Ext.ux.grid.header.Filters'],
    
        requires: [
            'Ext.container.Container',
            'Ext.tip.ToolTip'
        ],
    
    
    
    
        grid: null,
    
        fields: null,
    
        containers: null,
    
        storeLoaded: false,
    
        filterFieldCls: 'x-gridheaderfilters-filter-field',
    
        filterContainerCls: 'x-gridheaderfilters-filter-container',
    
        filterRoot: 'data',
    
        tooltipTpl: '{[Ext.isEmpty(values.filters) ? this.text.noFilter : "<b>"+this.text.activeFilters+"</b>"]}<br><tpl for="filters"><tpl if="value != \'\'">{[values.label ? values.label : values.property]} = {value}<br></tpl></tpl>',
    
        lastApplyFilters: null,
    
        bundle: {
            activeFilters: 'Active filters',
            noFilter: 'No filter'
        },
    
        /**
        * @cfg {Boolean} stateful
        * Specifies if headerFilters values are saved into grid status when filters changes.
        * This configuration can be overridden from grid configuration parameter <code>statefulHeaderFilters</code> (if defined).
        * Used only if grid <b>is stateful</b>. Default = true.
        * 
        */
        stateful: true,
    
       /**
       * @cfg {Boolean} reloadOnChange
       * Specifies if the grid store will be auto-reloaded when filters change. The store
       * will be reloaded only if is was already loaded. If the store is local or it doesn't has remote filters
       * the store will be always updated on filters change.
       * 
       */
       reloadOnChange: true,
    
        /**
       * @cfg {Boolean} ensureFilteredVisible
       * If the column on wich the filter is set is hidden and can be made visible, the
       * plugin makes the column visible.
       */
        ensureFilteredVisible: true,
    
        /**
        * @cfg {Boolean} enableTooltip
        * If a tooltip with active filters description must be enabled on the grid header
        */
        enableTooltip: true,
    
        statusProperty: 'headerFilters',
    
        rendered: false,
    
       constructor: function(cfg) 
       {
           if(cfg)
           {
            Ext.apply(this,cfg);
           }
       },
    
       init: function(grid)
       {
           this.grid = grid;
    
            /*var storeProxy = this.grid.getStore().getProxy();
            if(storeProxy && storeProxy.getReader())
            {
                var reader = storeProxy.getReader();
                this.filterRoot = reader.root ? reader.root : undefined;
            }*/
            /**
             * @cfg {Object} headerFilters
             * <b>Configuration attribute for grid</b>
             * Allows to initialize header filters values from grid configuration.
             * This object must have filter names as keys and filter values as values.
             * If this plugin has {@link #stateful} enabled, the saved filters have priority and override these filters.
             * Use {@link #ignoreSavedHeaderFilters} to ignore current status and apply these filters directly.
             */
           if(!grid.headerFilters)
               grid.headerFilters = {};
    
    
           if(Ext.isBoolean(grid.statefulHeaderFilters))
           {
               this.setStateful(grid.statefulHeaderFilters);
           }
    
            this.grid.addEvents(
          /**
            * @event headerfilterchange
            * <b>Event enabled on the Grid</b>: fired when at least one filter is updated after apply.
            * @param {Ext.grid.Panel} grid The grid
            * @param {Ext.util.MixedCollection} filters The applied filters (after apply). Ext.util.Filter objects.
            * @param {Ext.util.MixedCollection} prevFilters The old applied filters (before apply). Ext.util.Filter objects.
            * @param {Number} active Number of active filters (not empty)
            * @param {Ext.data.Store} store Current grid store
            */    
            'headerfilterchange',
            /**
             * @event headerfiltersrender
             * <b>Event enabled on the Grid</b>: fired when filters are rendered
             * @param {Ext.grid.Panel} grid The grid
             * @param {Object} fields The filter fields rendered. The object has for keys the filters names and for value Ext.form.field.Field objects.
             * @param {Object} filters Current header filters. The object has for keys the filters names and for value the filters values.
            */
                'headerfiltersrender',
                /**
             * @event beforeheaderfiltersapply
             * <b>Event enabled on the Grid</b>: fired before filters are confirmed. If the handler returns false no filter apply occurs.
             * @param {Ext.grid.Panel} grid The grid
             * @param {Object} filters Current header filters. The object has for keys the filters names and for value the filters values.
             * @param {Ext.data.Store} store Current grid store
             */
            'beforeheaderfiltersapply',
            /**
             * @event headerfiltersapply
             *<b>Event enabled on the Grid</b>: fired when filters are confirmed.
             * @param {Ext.grid.Panel} grid The grid
             * @param {Object} filters Current header filters. The object has for keys the filters names and for value the filters values.
             * @param {Number} active Number of active filters (not empty)
             * @param {Ext.data.Store} store Current grid store
             */
            'headerfiltersapply'
            );
    
            this.grid.on({
                scope: this,
                columnresize: this.resizeFilterContainer,
                beforedestroy: this.onDestroy,
                beforestatesave: this.saveFilters,
                afterlayout: this.adjustFilterWidth
            });
    
            this.grid.headerCt.on({
                scope: this,
                afterrender: this.renderFilters
            });
    
            this.grid.getStore().on({
                scope: this,
                load: this.onStoreLoad
            });
    
            if(this.reloadOnChange)
            {
                this.grid.on('headerfilterchange',this.reloadStore, this);
            }
    
            if(this.stateful)
            {
                this.grid.addStateEvents('headerfilterchange');
            }
    
            //Enable new grid methods
            Ext.apply(this.grid, 
            {
                headerFilterPlugin: this,
                setHeaderFilter: function(sName, sValue)
                {
                    if(!this.headerFilterPlugin)
                        return;
                    var fd = {};
                    fd[sName] = sValue;
                    this.headerFilterPlugin.setFilters(fd);
                },
                /**
                 * Returns a collection of filters corresponding to enabled header filters.
                 * If a filter field is disabled, the filter is not included.
                 * <b>This method is enabled on Grid</b>.
                 * @method
                 * @return {Array[Ext.util.Filter]} An array of Ext.util.Filter
                 */
                getHeaderFilters: function()
                {
                    if(!this.headerFilterPlugin)
                        return null;
                    return this.headerFilterPlugin.getFilters();
                },
                /**
                 * Set header filter values
                 * <b>Method enabled on Grid</b>
                 * @method
                 * @param {Object or Array[Object]} filters An object with key/value pairs or an array of Ext.util.Filter objects (or corresponding configuration).
                 * Only filters that matches with header filters names will be set
                 */
                setHeaderFilters: function(obj)
                {
                    if(!this.headerFilterPlugin)
                        return;
                    this.headerFilterPlugin.setFilters(obj);
                },
                getHeaderFilterField: function(fn)
                {
                    if(!this.headerFilterPlugin)
                        return;
                    if(this.headerFilterPlugin.fields[fn])
                        return this.headerFilterPlugin.fields[fn];
                    else
                        return null;
                },
                resetHeaderFilters: function()
                {
                    if(!this.headerFilterPlugin)
                        return;
                    this.headerFilterPlugin.resetFilters();
                },
                clearHeaderFilters: function()
                {
                    if(!this.headerFilterPlugin)
                        return;
                    this.headerFilterPlugin.clearFilters();
                },
                applyHeaderFilters: function()
                {
                    if(!this.headerFilterPlugin)
                        return;
                    this.headerFilterPlugin.applyFilters();
                }
            });
       },
    
    
    
        saveFilters: function(grid, status)
        {
            status[this.statusProperty] = (this.stateful && this.rendered) ? this.parseFilters() : grid[this.statusProperty];
        },
    
        setFieldValue: function(field, value)
        {
            var column = field.column;
            if(!Ext.isEmpty(value))
            {
                field.setValue(value);
                if(!Ext.isEmpty(value) && column.hideable && !column.isVisible() && !field.isDisabled() && this.ensureFilteredVisible)
                {
                    column.setVisible(true);
                }
            }
            else
            {
                field.setValue('');
            }
        },
    
        renderFilters: function()
        {
            this.destroyFilters();
    
            this.fields = {};
            this.containers = {};
    
    
    
    
            var filters = this.grid.headerFilters;
    
            /**
             * @cfg {Boolean} ignoreSavedHeaderFilters
             * <b>Configuration parameter for grid</b>
             * Allows to ignore saved filter status when {@link #stateful} is enabled.
             * This can be useful to use {@link #headerFilters} configuration directly and ignore status.
             * The state will still be saved if {@link #stateful} is enabled.
             */
            if(this.stateful && this.grid[this.statusProperty] && !this.grid.ignoreSavedHeaderFilters)
            {
                Ext.apply(filters, this.grid[this.statusProperty]);
            }
    
            var storeFilters = this.parseStoreFilters();
            filters = Ext.apply(storeFilters, filters);
    
            var columns = this.grid.headerCt.getGridColumns(true);
            for(var c=0; c < columns.length; c++)
            {
                var column = columns[c];
                if(column.filter)
                {
                    var filterContainerConfig = {
                        itemId: column.id + '-filtersContainer',
                        cls: this.filterContainerCls,
                        layout: 'anchor',
                        bodyStyle: {'background-color': 'transparent'},
                        border: false,
                        width: column.getWidth(),
                        listeners: {
                            scope: this,
                            element: 'el',
                            mousedown: function(e)
                            {
                                e.stopPropagation();
                            },
                            click: function(e)
                            {
                                e.stopPropagation();
                            },
                            keydown: function(e){
                                 e.stopPropagation();
                            },
                            keypress: function(e){
                                 e.stopPropagation();
                                 if(e.getKey() == Ext.EventObject.ENTER)
                                 {
                                     this.onFilterContainerEnter();
                                 }
                            },
                            keyup: function(e){
                                 e.stopPropagation();
                            }
                        },
                        items: []
                    }
    
                    var fca = [].concat(column.filter);
    
                    for(var ci = 0; ci < fca.length; ci++)
                    {
                        var fc = fca[ci];
                        Ext.applyIf(fc, {
                            filterName: column.dataIndex,
                            fieldLabel: column.text || column.header,
                            hideLabel: fca.length == 1
                        });
                        var initValue = Ext.isEmpty(filters[fc.filterName]) ? null : filters[fc.filterName];
                        Ext.apply(fc, {
                            cls: this.filterFieldCls,
                            itemId: fc.filterName,
                            anchor: '-1'
                        });
                        var filterField = Ext.ComponentManager.create(fc);
                        filterField.column = column;
                        this.setFieldValue(filterField, initValue);
                        this.fields[filterField.filterName] = filterField;
                        filterContainerConfig.items.push(filterField);
                    }
    
                    var filterContainer = Ext.create('Ext.container.Container', filterContainerConfig);
                    filterContainer.render(column.el);
                    this.containers[column.id] = filterContainer;
                    column.setPadding = Ext.Function.createInterceptor(column.setPadding, function(h){return false});
                }
            }
    
            if(this.enableTooltip)
            {
                this.tooltipTpl = new Ext.XTemplate(this.tooltipTpl,{text: this.bundle});
                this.tooltip = Ext.create('Ext.tip.ToolTip',{
                    target: this.grid.headerCt.el,
                    //delegate: '.'+this.filterContainerCls,
                    renderTo: Ext.getBody(),
                    html: this.tooltipTpl.apply({filters: []})
                });        
                this.grid.on('headerfilterchange',function(grid, filters)
                {
                    var sf = filters.filterBy(function(filt){
                        return !Ext.isEmpty(filt.value);
                    });
                    this.tooltip.update(this.tooltipTpl.apply({filters: sf.getRange()}));
                },this);
            }
    
            this.applyFilters();
            this.rendered = true;
            this.grid.fireEvent('headerfiltersrender',this.grid,this.fields,this.parseFilters());
        },
    
        onStoreLoad: function()
        {
            this.storeLoaded = true;
        },
    
        onFilterContainerEnter: function()
        {
            this.applyFilters();
        },
    
        resizeFilterContainer: function(headerCt,column,w,opts)
        {
             if(!this.containers)             return;
            var cnt = this.containers[column.id];
            if(cnt)
            {
                cnt.setWidth(w);
                cnt.doLayout();
            }
        },
    
        destroyFilters: function()
        {
            this.rendered = false;
             if(this.fields)
             {
                 for(var f in this.fields)
                     Ext.destroy(this.fields[f]);
                 delete this.fields;
             }
    
             if(this.containers)
             {
                 for(var c in this.containers)
                     Ext.destroy(this.containers[c]);
                 delete this.containers;
             }
        },
    
        onDestroy: function()
        {
            this.destroyFilters();
            Ext.destroy(this.tooltip, this.tooltipTpl);
        },
    
         adjustFilterWidth: function() 
        {
            if(!this.containers) return;
            var columns = this.grid.headerCt.getGridColumns(true);        
            for(var c=0; c < columns.length; c++) 
            {           
                var column = columns[c];            
                if (column.filter && column.flex) 
                {               
                    this.containers[column.id].setWidth(column.getWidth()-1);            
                }
            }
         },
    
        resetFilters: function()
        {
            if(!this.fields)
                return;
            for(var fn in this.fields)
            {
                var f = this.fields[fn];
                if(!f.isDisabled() && !f.readOnly && Ext.isFunction(f.reset))
                    f.reset();
            }
            this.applyFilters();
        },
    
        clearFilters: function()
        {
            if(!this.fields)
                return;
            for(var fn in this.fields)
            {
                var f = this.fields[fn];
                if(!f.isDisabled() && !f.readOnly)
                    f.setValue('');
            }
            this.applyFilters();
        },
    
        setFilters: function(filters)
        {
            if(!filters)
                return;
    
            if(Ext.isArray(filters))
            {
                var conv = {};
                Ext.each(filters, function(filter){
                    if(filter.property)
                    {
                        conv[filter.property] = filter.value; 
                    }
                });
                filters = conv;
            }
            else if(!Ext.isObject(filters))
            {
                return;
            }
    
    
    
    
            this.initFilterFields(filters);
            this.applyFilters();
        },
    
        getFilters: function()
        {
            var filters = this.parseFilters();
            var res = new Ext.util.MixedCollection();
            for(var fn in filters)
            {
                var value = filters[fn];
                var field = this.fields[fn];
                res.add(new Ext.util.Filter({
                    property: fn,
                    value: value,
                    root: this.filterRoot,
                    label: field.fieldLabel
                }));
            }
            return res;
        },
    
        parseFilters: function()
        {
            var filters = {};
            if(!this.fields)
                return filters;
            for(var fn in this.fields)
            {
                var field = this.fields[fn];
                if(!field.isDisabled() && field.isValid())
                    filters[field.filterName] = field.getSubmitValue();
            }
            return filters;
        },
    
        initFilterFields: function(filters)
        {
            if(!this.fields)
                return;
    
    
    
    
            for(var fn in  filters)
            {
                var value = filters[fn];
                var field = this.fields[fn];
                if(field)
                {
                    this.setFieldValue(filterField, initValue);
                }
            }
        },
    
        countActiveFilters: function()
        {
            var fv = this.parseFilters();
            var af = 0;
            for(var fn in fv)
            {
                if(!Ext.isEmpty(fv[fn]))
                    af ++;
            }
            return af;
        },
    
        parseStoreFilters: function()
        {
            var sf = this.grid.getStore().filters;
            var res = {};
            sf.each(function(filter){
                var name = filter.property;
                var value = filter.value;
                if(name && value)
                {
                    res[name] = value;            
                }
            });
            return res;
        },
    
        applyFilters: function()
        {
            var filters = this.parseFilters();
            if(this.grid.fireEvent('beforeheaderfiltersapply', this.grid, filters, this.grid.getStore()) !== false)
            {
                var storeFilters = this.grid.getStore().filters;
                var exFilters = storeFilters.clone();
                var change = false;
                var active = 0;
                for(var fn in filters)
                {
                    var value = filters[fn];
    
                    var sf = storeFilters.findBy(function(filter){
                        return filter.property == fn;
                    });
    
                    if(Ext.isEmpty(value))
                    {
                        if(sf)
                        {
                            storeFilters.remove(sf);
                            change = true;
                        }
                    }
                    else
                    {
                        var field = this.fields[fn];
                        if(!sf || sf.value != filters[fn])
                        {
                            var newSf = new Ext.util.Filter({
                                root: this.filterRoot,
                                property: fn,
                                value: filters[fn],
                                label: field.fieldLabel
                            });
                            if(sf)
                            {
                                storeFilters.remove(sf);
                            }
                            storeFilters.add(newSf);
                            change = true;
                        }
                        active ++;
                    }
                }
    
                this.grid.fireEvent('headerfiltersapply', this.grid, filters, active, this.grid.getStore());
                if(change)
                {
                    var curFilters = this.getFilters();
                    this.grid.fireEvent('headerfilterchange', this.grid, curFilters, this.lastApplyFilters, active, this.grid.getStore());
                    this.lastApplyFilters = curFilters;
                }
            }
        },
    
        reloadStore: function()
        {
            var gs = this.grid.getStore();
            if(this.grid.getStore().remoteFilter)
            {
                if(this.storeLoaded)
                {
                    gs.currentPage = 1;
                    gs.load();
                }
            }
            else
          {
                if(gs.filters.getCount()) 
             {
                    if(!gs.snapshot)
                        gs.snapshot = gs.data.clone();
                    else
                    {
                        gs.currentPage = 1;
                    }
                gs.data = gs.snapshot.filter(gs.filters.getRange());
                var doLocalSort = gs.sortOnFilter && !gs.remoteSort;
                if(doLocalSort)
                    {
                        gs.sort();
                    }
                // fire datachanged event if it hasn't already been fired by doSort
                if (!doLocalSort || gs.sorters.length < 1) 
                {
                    gs.fireEvent('datachanged', gs);
                    }
                }
               else
               {
                    if(gs.snapshot)
                    {
                        gs.currentPage = 1;
                        gs.data = gs.snapshot.clone();
                     delete gs.snapshot;
                     gs.fireEvent('datachanged', gs);
                    }
                }
            }
        }
    });
    

    Add in your grid class the following rows:

    • plugin for the grid:

      plugins: [Ext.create('Ext.ux.grid.plugin.HeaderFilters')/*, ... other plugins here */]
      
    • column configuration:

      columns:[{ /*other configurations for your column:*/
             header: 'Accepted', dataIndex: 'accepted', flex: 1,
             /*filter plugin configuration:*/
             filterable: true, filter:{xtype: 'textfield' /* i've used a simple textbox*/}}
             /*, other columns here */]
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am using JSon response to parse title,date content and thumbnail images and place
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I am confused How to use looping for Json response Array in another Array.
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.