0
votes

I have a grid of which store is filtered in server side. This is the store:

var _store = Ext.create('Ext.data.Store', {
    model: isemriModel,
    storeId: 'storeFiltered' + _id,
    pageSize: 5,
    autoLoad: { filter: JSON.stringify(filterObject) },
    proxy: {
        type: 'ajax',
        actionMethods: {
            read: 'POST'
        },
        url: _url,
        extraParams: {
            kullaniciAdi: _userName,
            sifre: _password,
            filter: JSON.stringify(filterObject)
        },
        reader: {
        rootProperty: 'isemirleri',
        totalProperty: 'totalCount'
        }
    },
    listeners: {
        beforeload: function (store, operation, opts) {
        },    
        load: function (store) {
        }
    }
});

Here is my problem: When I make a search for records which contains specific letters, names etc (for example names containing a). First page appears correct. But when I change the grid page from paging toolbar, filter parameter is cleared and non filtered records appears.

I also tried

store.load({ params: { filter: JSON.stringify(filterObject) } });

but it does not work. Can anybody help?

Attention: I make the filtering at server side, not at ext store. Is it possible to load store with dynamically changing parameters using a grid with paging toolbar.

2

2 Answers

0
votes

on load function set again your filter to the current page. Also if the store is the same, pages have differents filters. Infact probably if you try to return to the filtered page you'll se the filter isn't cleared.

simply every page can have a different filter.

remember to clear all page filters if you use the same filter in more than one page

0
votes

You should use

remoteFilter: true

and the built-in filter functions for your store. Your proxy page _url will get the filter by an other way but your filter will be kept between different loads.