How to queryBy/filterBy on all page of Grid Store data?

1.6k Views Asked by At

I have a grid panel containing store displayed on many pages (using PagingToolbar).

On the tbar, I put the button to have a query for all data in store according record.get("criterion"). I've tried using queryBy, but it's returning none. So, I use filterBy in button handler, as coded below:

 new Ext.Button(
        {
            text: 'Query',
            icon: 'img/icon_search.gif',
            scope: this,
            handler:function(){                 
                my_store.filterBy(
                function(record, id) {
                    return record.get('field_name') == 'The Content of Field Name';               
                }); 
            }
        }
    ),

Unfortunately, the query (filter) above only search on current page of grid. How to get all filtered (queried) data from other pages that doesn't displayed?

2

There are 2 best solutions below

0
On

Look at using remoteFilter on your store, or using the GridFilter plugin.

0
On
store.filterBy(function(record)
{                                                 
    return  lines.indexOf(record.get("line_code")code)>0?true:false;
},store.getAllRange()