Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Oct 2007
    Location
    Iran
    Posts
    159
    Vote Rating
    0
    vahid4134 is on a distinguished road

      0  

    Default [4.0.0] Filter with no column with filter error

    [4.0.0] Filter with no column with filter error


    Hi
    Sorry for my bad english
    if set filter in grid panel and set no filter for column when I try to show column menu I have error
    Code:
    Ext.Loader.setConfig({enabled: true});
    Ext.Loader.setPath('Ext.ux', '../ux');
    Ext.require([
        'Ext.grid.*',
        'Ext.data.*',
        'Ext.ux.grid.FiltersFeature',
        'Ext.toolbar.Paging'
    ]);
    
    Ext.onReady(function(){
    
        Ext.QuickTips.init();
    
        // for this demo configure local and remote urls for demo purposes
        var url = {
            local:  'grid-filter.json',  // static data file
            remote: 'grid-filter.php'
        };
    
        // configure whether filter query is encoded or not (initially)
        var encode = false;
        
        // configure whether filtering is performed locally or remotely (initially)
        var local = true;
    
        var store = Ext.create('Ext.data.JsonStore', {
            // store configs
            autoDestroy: true,
    
            proxy: {
                type: 'ajax',
                url: (local ? url.local : url.remote),
                reader: {
                    type: 'json',
                    root: 'data',
                    idProperty: 'id',
                    totalProperty: 'total'
                }
            },
    
            remoteSort: false,
            sortInfo: {
                field: 'company',
                direction: 'ASC'
            },
            pageSize: 50,
            storeId: 'myStore',
            
            fields: [
                { name: 'id' },
                { name: 'company' }, 
                { name: 'price', type: 'float' },
                { name: 'date', type: 'date', dateFormat: 'Y-m-d' },
                { name: 'visible', type: 'boolean' },
                { name: 'size' }
            ]
        });
    
        var filters = {
            ftype: 'filters',
            // encode and local configuration options defined previously for easier reuse
            encode: encode, // json encode the filter query
            local: local
        };
    
        // use a factory method to reduce code while demonstrating
        // that the GridFilter plugin may be configured with or without
        // the filter types (the filters may be specified on the column model
        var createHeaders = function (finish, start) {
    
            var columns = [{
                dataIndex: 'id',
                text: 'Id',
                // instead of specifying filter config just specify filterable=true
                // to use store's field's type property (if type property not
                // explicitly specified in store config it will be 'auto' which
                // GridFilters will assume to be 'StringFilter'
                //filterable: true
                //,filter: {type: 'numeric'}
            }, {
                dataIndex: 'company',
                text: 'Company',
                id: 'company',
                flex: 1,
    /*
                filter: {
                    type: 'string'
                    // specify disabled to disable the filter menu
                    //, disabled: true
                }
    */
            }, {
                dataIndex: 'price',
                text: 'Price',
               /* filter: {
                    //type: 'numeric'  // specify type here or in store fields config
                }
    */
            }, {
                dataIndex: 'size',
                text: 'Size',
    	/*
                filter: {
                    type: 'list',
                    options: ['small', 'medium', 'large', 'extra large']
                    //,phpMode: true
                }
    */
            }, {
                dataIndex: 'date',
                text: 'Date',
                renderer: Ext.util.Format.dateRenderer('m/d/Y'),
    /*
                filter: {
                    //type: 'date'     // specify type here or in store fields config
                }            
    */
            }, {
                dataIndex: 'visible',
                text: 'Visible',
    /*
                filter: {
                    //type: 'boolean'  // specify type here or in store fields config
                }
    */
            }];
    
            return columns.slice(start || 0, finish);
        };
        
        var grid = Ext.create('Ext.grid.Panel', {
            border: false,
            store: store,
            columns: createHeaders(4),
            loadMask: true,
            features: [filters],
            bbar: Ext.create('Ext.toolbar.Paging', {
                store: store
            })
        });
    
        // add some buttons to bottom toolbar just for demonstration purposes
        grid.child('[dock=bottom]').add([
            '->',
            {
                text: 'Encode: ' + (encode ? 'On' : 'Off'),
                tooltip: 'Toggle Filter encoding on/off',
                enableToggle: true,
                handler: function (button, state) {
                    var encode = (grid.filters.encode !== true);
                    var text = 'Encode: ' + (encode ? 'On' : 'Off'); 
                    grid.filters.encode = encode;
                    grid.filters.reload();
                    button.setText(text);
                } 
            },
            {
                text: 'Local Filtering: ' + (local ? 'On' : 'Off'),
                tooltip: 'Toggle Filtering between remote/local',
                enableToggle: true,
                handler: function (button, state) {
                    var local = (grid.filters.local !== true),
                        text = 'Local Filtering: ' + (local ? 'On' : 'Off'),
                        newUrl = local ? url.local : url.remote,
                        store = grid.view.getStore();
                     
                    // update the GridFilter setting
                    grid.filters.local = local;
                    // bind the store again so GridFilters is listening to appropriate store event
                    grid.filters.bindStore(store);
                    // update the url for the proxy
                    store.proxy.url = newUrl;
    
                    button.setText(text);
                    store.load();
                } 
            },
            {
                text: 'All Filter Data',
                tooltip: 'Get Filter Data for Grid',
                handler: function () {
                    var data = Ext.encode(grid.filters.getFilterData());
                    Ext.Msg.alert('All Filter Data',data);
                } 
            },{
                text: 'Clear Filter Data',
                handler: function () {
                    grid.filters.clearFilters();
                } 
            },{
                text: 'Add Columns',
                handler: function () {
                    if (grid.headerCt.items.length < 6) {
                        grid.headerCt.add(createHeaders(6, 4));
                        grid.view.refresh();
                        this.disable();
                    }
                }
            }    
        ]);
    
        var win = Ext.create('Ext.Window', {
            title: 'Grid Filters Example',
            height: 400,
            width: 700,
            layout: 'fit',
            items: grid
        }).show();
    
        store.load();
    });
    error
    Code:
    Cls is not a constructor
    http://localhost/ext-4.0.0/examples/ux/grid/FiltersFeature.js?_dc=1304526480039
    Line 522
    No honor is like knowledge

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    6
    Vote Rating
    0
    abs is on a distinguished road

      0  

    Default Getting same with Ext JS 4

    Getting same with Ext JS 4


    I have set filterable:true on columns and then using the FiltersFeature from Ext.ux.

Similar Threads

  1. Replies: 5
    Last Post: 21 Aug 2011, 8:36 PM
  2. DataStore filter: How to refresh grid after filter applied?
    By Tumac in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 8 Nov 2010, 9:08 AM
  3. Replies: 3
    Last Post: 27 Oct 2010, 8:20 AM
  4. Replies: 1
    Last Post: 8 May 2009, 8:01 AM
  5. [2.2] Minor, Docs - Class filter field inappropriately applies filter
    By jay@moduscreate.com in forum Ext 2.x: Bugs
    Replies: 0
    Last Post: 5 Nov 2008, 4:01 AM

Thread Participants: 1