Results 1 to 2 of 2

Thread: Application of Grid and Store filtering

  1. #1
    Ext JS Premium Member
    Join Date
    Nov 2010

    Default Application of Grid and Store filtering

    My website processes a continuously updating stream of JSON - In an effort to keep traffic at a minimum I'd like to maintain a store of updates that is used for more than one grid. Currently, as updates come in, the affected rows are updated in an with a JSON reader. The store is bound to an Ext.grid.GridPanel and Ext.DataView panel.

    The problem comes in when I try to create a second GridPanel from the same store (but filtered). Any filtering applied to one grid results in modifying the other. I've researched 2 types of filtering:
    1.) Use plugin for GridFilters

    As an example, I modified the grid-filtering example grid-filter-local.js and added my own button to apply a custom filter:

    1. handler: function () {
    2. grid.filters.clearFilters(); //for some reason, this is required first to set the filter programatically
    3. grid.filters.addFilter({ "dataIndex": "company", "type": "string", "value": "w"});
    4. }

    Creating a second grid panel and column model, but bound to the same store will end up applying filters and sorting to both grids

    2.) Apply filter on store

    myStore.filter('company', 'w', true, true);
    Again, any grids using this store get filtered.

    Do I have to create a copy of the store to apply different filtering? Should I be looking at some other Ext data structure?

    Any help is much appreciated,

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    The Netherlands


    Correct, a store filter applies to all linked components, so if you want to display some components with all data and some with filtered data, you will need two stores.

Similar Threads

  1. sencha touch application for the iphone / android application store
    By wpichler in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 31 Aug 2010, 6:17 AM
  2. Filtering store using combobox or Textfield and show it in the grid
    By paweluz in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 16 Jun 2010, 12:34 AM
  3. Grid's store filtering question.
    By dreamcaster in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 13 Dec 2009, 8:02 PM
  4. Grid/Store filtering
    By CJPartridge in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 23 Mar 2009, 4:40 PM

Tags for this Thread

Posting Permissions

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