Results 1 to 3 of 3

Thread: Ext.ux.grid.FiltersFeature: getFilter() is undefined

  1. #1
    Sencha User
    Join Date
    May 2011
    Vote Rating

    Question Ext.ux.grid.FiltersFeature: getFilter() is undefined

    Dear Community,

    I'm new to ExtJS and I'm facing some problems with Ext.ux.grid.FiltersFeature.
    I have a grid with Filter feature:

    Ext.define('' ,{
        extend: 'Ext.grid.Panel',
        alias : 'widget.booklistozon',
        title : 'Books grid',
        store: 'BooksOzon',
        features: [{
            ftype: 'filters',
            encode: true,
            local: true,
            autoReload: false,
            filters: [{
                type: 'numeric',
                dataIndex: 'id'
                type: 'string',
                dataIndex: 'author'
                type: 'string',
                dataIndex: 'name'
        columns: [{
            header: 'Id',
            dataIndex: 'id',
            width: 70
            header: 'Author',
            dataIndex: 'author',
            flex: 2
            header: 'Book Title',
            dataIndex: 'name',
            flex: 3
    I need to activate filter with some value by a button from outside a grid.
    I'm using the following code for a button click handler:

    var bookListOzon = this.getBookListOzon();
    var filterId = bookListOzon.filters.getFilter('author');
    It works well after filter is activated manually for 'author' column (e.g. ='author_1').
    But if I try to click a button when filter is not set manually before, I got an error since bookListOzon.filters.getFilter('author') is undefined.

    It seems to me this behavior is not correct. How can I set a value for a filter if it wasn't filled with some value before?

  2. #2
    Sencha User
    Join Date
    Nov 2010
    Vote Rating


    It tooks me a long time too, this night.
    In the end I found that this code should work:
    (change mygrid with the name of your grid)
    mygrid.filters.addFilter({dataIndex: 'author', type: 'string', value: 'author_2'});;
    If you prefer you can even use
    insetad of
    To preserve the local or remote filtering settings
    Make us know if it worked for you too!

    Have a nice day!

  3. #3
    Sencha Premium Member
    Join Date
    May 2011
    Vote Rating

    Default Works for me!

    I was able to get this working via a button. I'm about to tie it in with some checkbox functionality which brings up an issue I've been having. Right now whenever I addFilter to a grid's store the filters are applied using an AND condition. How do I apply filters using the OR condition?

    For instance, using the FiltersFeatures.js bound to columns in a datagrid I can select two options from a list in a single column and the filters does Option1 OR Option2. It even does ORs for other columns as well.

    So, how do I do that by programatically adding the filters?


Similar Threads

  1. Replies: 14
    Last Post: 8 Dec 2011, 11:17 AM
  2. Replies: 3
    Last Post: 26 Apr 2011, 11:06 AM
  3. Grid, C is Undefined
    By panosru in forum Ext 2.x: Help & Discussion
    Replies: 14
    Last Post: 8 Jun 2010, 1:50 AM
  4. extended Grid gives this.ds is undefined
    By jsemmanuel in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 22 Dec 2009, 8:19 AM
  5. [3.0] this.grid is undefined
    By FkrZiM in forum Ext 3.x: Help & Discussion
    Replies: 11
    Last Post: 26 Aug 2009, 7:07 AM

Posting Permissions

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