extjszend-frameworkfilterpropel

Filtering in ExtJS


I am filtering a store in extjs:

So far so good, the Problem I have that's not matter if the function returns true or false, the entity still stay in my store.

Thanks for your Help, Daniel


Solution

  • Ext.getStore('xxx').filterBy() works locally on the data retrieved from the proxy. So if you fire Ext.getStore('xxx').load() or Ext.getStore('xxx').reload() this will wipe the local filtered data with the data retrieved from the server.

    You can also use Ext.getStore('xxx').load({params:{'param1':'value1'}}) to make the filtration from the server side.

    Now note that if you want to use the same params again you can just call Ext.getStore('xxx').reload() and now this is equal to Ext.getStore('xxx').load({params:{'param1':'value1'}}). But if you use Ext.getStore('xxx').load() it is like you are sending no parameters to the server.

    Finally you should first use Ext.getStore('xxx').load({params:{'param1':'value1'}}) or Ext.getStore('xxx').load() to get your data from the server then use filterBy to apply a local filter to the retrieved data.

    NB: I am assuming you are using ajax or rest proxy not local proxies