1. #1
    Sencha Premium Member Nxs's Avatar
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    2
    Nxs is on a distinguished road

      0  

    Default Unanswered: Add grid filter programmatically

    Unanswered: Add grid filter programmatically


    Hi,

    I have a grid that is already rendered, and I try to add to it a filter (Ext.ux.grid.FiltersFeature) dynamically.

    This is the way I follow:

    Code:
    // Create filter property
    var filtersCfg = {                
    ftype: 'filters',
    autoReload: true,
    encode: true,
    local: false,
    filters: [{
    type: 'numeric',
    dataIndex: 'Stock'
    }]
    } // Apply config on the fly Ext.apply(grid, { features: filtersCfg });
    That's not seem to change anything on the grid (the filter menu on the stock column is still not visible).

    Although in Chrome console the 'features' property on the grid is filled with the filter config and has the stock filter in the 'filters' array...

    Do I need to refresh something ? Or what is the right way to simply add a new column filter on the fly ?

    Thanks.

  2. #2
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,120
    Vote Rating
    30
    Answers
    85
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default


    Have you loaded/included the ux library (js) separately? Its not default in the Ext library.

  3. #3
    Sencha Premium Member Nxs's Avatar
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    2
    Nxs is on a distinguished road

      0  

    Default


    Yes I already use it with other grids created by prog (not by a designer) so I can set directly the grid's features property in the "Ext.create..." function and filters work perfectly.

Thread Participants: 1

Tags for this Thread