[CLOSED] GridPanel with local filtering

  1. #1

    [CLOSED] GridPanel with local filtering

    Hello,
    after applying a local gridfilter to a gridpanel column, what is the best way of accessing the records that are left as a result of the filter? I'd like to access them client side if possible?
    Thank you,
    Kevin
    Last edited by Daniil; Dec 18, 2013 at 2:48 AM. Reason: [CLOSED]
  2. #2
    Quote Originally Posted by Kev View Post
    Hello,
    after applying a local gridfilter to a gridpanel column, what is the best way of accessing the records that are left as a result of the filter? I'd like to access them client side if possible?
    Thank you,
    Kevin
    The Store .data will be updated with only the filtered records. The following sample demonstrates looping through each of the records in the Store.

    Example

    App.Store1.each(function (record) {
        console.log(record);
    });
    Or, you can access the Record collection directly.

    App.Store1.data.items
    The client-side Store docs can help with more api calls for accessing Records.

    http://docs.sencha.com/extjs/4.2.1/#...Ext.data.Store

    Hope this helps.
    Last edited by Daniil; Dec 10, 2013 at 3:54 AM. Reason: 4.2.2 => 4.2.1 in the ExtJS link
    Geoffrey McGill
    Founder
  3. #3
    Quote Originally Posted by geoffrey.mcgill View Post
    The Store .data will be updated with only the filtered records. The following sample demonstrates looping through each of the records in the Store.

    Example

    App.Store1.each(function (record) {
        console.log(record);
    });
    Or, you can access the Record collection directly.

    App.Store1.data.items
    The client-side Store docs can help with more api calls for accessing Records.

    http://docs.sencha.com/extjs/4.2.1/#...Ext.data.Store

    Hope this helps.
    I have followed this example where the filter is applied on the server via a direct event:

    https://examples2.ext.net/#/GridPane...Filters_Local/

    The FilterUpdate listener on the gridfilter is called before the store is actually filtered though. So the store doesn't contain the filtered records. Is there any workaround for this?
  4. #4
    Hi,

    Yes, I think the FilterUpdate fires when a UI filter elements is update (for example, a user types something in a TextField).

    To catch filtering of Store, please try to use its FilterChange event.
    http://docs.sencha.com/extjs/4.2.1/#...t-filterchange

Similar Threads

  1. [CLOSED] Local sorting with local filtering and paging
    By g-tech in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 10, 2013, 3:36 AM
  2. Replies: 4
    Last Post: Nov 11, 2010, 11:46 AM
  3. Replies: 0
    Last Post: Aug 16, 2010, 10:28 PM
  4. Replies: 0
    Last Post: May 11, 2010, 10:35 PM
  5. remote and local filtering
    By marcmvc in forum 1.x Help
    Replies: 0
    Last Post: Oct 13, 2009, 12:38 PM

Tags for this Thread

Posting Permissions