Results 1 to 6 of 6

Thread: grid Filter in MVC

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Bandung, Indonesia
    Posts
    12

    Default Answered: grid Filter in MVC

    I was just learning MVC concepts in extjs, but my difficulty implementing the filtering grid in MVC concept, I've tried it several times but still there is an error in my application, is there anything that can give an example?

    Code:
    Ext.define('App.view.user.List' ,{
        extend: 'Ext.grid.Panel',
        alias : 'widget.userList',
        id:'userID',
        store: 'User',
        title : 'Users',
        layout: 'fit',
        features: [{ftype: 'filters',
                autoReload: true,
                local: true}],
        dockedItems: [{
            xtype: 'toolbar',
            items: [{
                iconCls: 'user_add',
                text: 'Add',
                action: 'addUser'
                
            },{
                iconCls: 'user_delete',
                text: 'Delete',
                disabled: true,
                itemId: 'deleteUser',
                action: 'delete'
            }]
        },{
            xtype: 'pagingtoolbar',
            store: 'User',   // mismo que el store GridPanel
            dock: 'bottom',
            displayInfo: true
        }],
        
        initComponent: function() {
            this.columns = [
                {header: 'ID',  dataIndex: 'userID',  flex: 1, filter: {type: 'numeric'}},
                {header: 'Name',  dataIndex: 'name',  flex: 1, filter: {type: 'string'}},
                {header: 'Last Name',  dataIndex: 'lastname',  flex: 1, filter: {type: 'string'}},
                {header: 'Age', dataIndex: 'age', flex: 1, filter: {type: 'numeric'}}
            ];
            
            this.callParent(arguments);
        }
    });





    and sorry with my english

  2. Have you included the path to Ext.ux.grid.FiltersFeature

    Code:
    Ext.Loader.setPath('Ext.ux', '../ux'); // path to where UX from your app root
    Ext.require([
        'Ext.grid.*',
        'Ext.data.*',
        'Ext.ux.grid.FiltersFeature'
    ]);
    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Where are you trying to add your filter? View or controller?

    Scott.

  4. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    Bandung, Indonesia
    Posts
    12

    Default

    Quote Originally Posted by scottmartin View Post
    Where are you trying to add your filter? View or controller?

    Scott.
    thank's before.
    i add my filter in view.
    and this my grid panel code
    Code:
    Ext.define('App.view.user.List' ,{
        extend: 'Ext.grid.Panel',
        alias : 'widget.userList',
        id:'userID',
        store: 'User',
        title : 'Users',
    	layout: 'fit',
    	features: [{ftype: 'filters',
                autoReload: true,
                local: true}],
        dockedItems: [{
            xtype: 'toolbar',
            items: [{
                iconCls: 'user_add',
                text: 'Add',
                action: 'addUser'
    			
            },{
                iconCls: 'user_delete',
                text: 'Delete',
                disabled: true,
                itemId: 'deleteUser',
                action: 'delete'
            }]
        },{
            xtype: 'pagingtoolbar',
            store: 'User',   // mismo que el store GridPanel
            dock: 'bottom',
            displayInfo: true
        }],
    	
        initComponent: function() {
            this.columns = [
                {header: 'ID',  dataIndex: 'userID',  flex: 1, filter: {type: 'numeric'}},
                {header: 'Name',  dataIndex: 'name',  flex: 1, filter: {type: 'string'}},
                {header: 'Last Name',  dataIndex: 'lastname',  flex: 1, filter: {type: 'string'}},
                {header: 'Age', dataIndex: 'age', flex: 1, filter: {type: 'numeric'}}
            ];
    		
            this.callParent(arguments);
        }
    });

    Is there something wrong with my gridpanel and filter

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Have you included the path to Ext.ux.grid.FiltersFeature

    Code:
    Ext.Loader.setPath('Ext.ux', '../ux'); // path to where UX from your app root
    Ext.require([
        'Ext.grid.*',
        'Ext.data.*',
        'Ext.ux.grid.FiltersFeature'
    ]);
    Scott.

  6. #5
    Sencha User
    Join Date
    Nov 2011
    Location
    Bandung, Indonesia
    Posts
    12

    Default

    Quote Originally Posted by scottmartin View Post
    Have you included the path to Ext.ux.grid.FiltersFeature

    Code:
    Ext.Loader.setPath('Ext.ux', '../ux'); // path to where UX from your app root
    Ext.require([
        'Ext.grid.*',
        'Ext.data.*',
        'Ext.ux.grid.FiltersFeature'
    ]);
    Scott.
    thanks. it works

  7. #6
    Sencha User
    Join Date
    Jun 2013
    Location
    India
    Posts
    1

    Default

    I am also facing the same issue in my MVC app. I am using filter in my grid view. I have set the Ux path and require file in app.js

Posting Permissions

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