PDA

View Full Version : How to mix remote and local filters?



yAdEs
26 Aug 2012, 8:26 PM
Like I have some remote filters in a store, and now I want to add another filter to do local filter,
but I can only set store's "remoteFilter" property to true or false,
how to seperate filters to local and remote?

scottmartin
27 Aug 2012, 1:14 PM
Can you provide more detail on what you are trying to accomplish?

Scott.

vietits
27 Aug 2012, 6:45 PM
You may use remoteFilter:true for remote filtering and then use filterBy() to locally filter.

bhgwn.jsh
3 Jun 2015, 2:19 AM
Hi,I have a scenario in which I want to use remoteFilter for grid column filter and local filtering for a textbox provided in toolbar on the same store. Can anyone suggest a better way to do this?

jreusser
5 Jun 2015, 12:28 PM
Hi,I have a scenario in which I want to use remoteFilter for grid column filter and local filtering for a textbox provided in toolbar on the same store. Can anyone suggest a better way to do this?

I'd create another store since you're in ExtJS 4. If you're in ExtJS5, use a chained store (http://docs.sencha.com/extjs/5.0/5.0.1-apidocs/#!/api/Ext.data.ChainedStore).

See below for creating another store in ExtJS4



var gridStore; // Comes from somewhere..where,you'll have to figure out ;)

// wherever you want to do the filtering/using the new store
var newStore = Ext.create("Ext.data.Store",{
data: gridStore.getData(),
model: gridStore.getModel()
});

mhenn
17 Jun 2015, 1:49 AM
*upvote*

We have remoteFilters to get a subset of records the proxy interface provides. The user should be able to filter this set locally, too.

Using filterBy() or a filter config with property filterFn set is the same and doesn't work when remoteFilter is set to true (ExtJS 5).

Error: Unable to use a filtering function in conjunction with remote filtering.

jreusser
17 Jun 2015, 5:40 AM
*upvote*

We have remoteFilters to get a subset of records the proxy interface provides. The user should be able to filter this set locally, too.

Using filterBy() or a filter config with property filterFn set is the same and doesn't work when remoteFilter is set to true (ExtJS 5).

I'd post this in the ExtJS 5 bug report forums :)

mhenn
17 Jun 2015, 5:47 AM
I'd post this in the ExtJS 5 bug report forums :)

Well, it's no bug to be honest, it's just broken by design.

But you're right, if this is working in ExtJS 4, I'll post it in the ExtJS 5 section.

jreusser
17 Jun 2015, 5:57 AM
Well, it's no bug to be honest, it's just broken by design.

But you're right, if this is working in ExtJS 4, I'll post it in the ExtJS 5 section.


You are correct... just tested

(https://fiddle.sencha.com/#fiddle/otc)

landoni
1 Oct 2015, 11:18 AM
Any updates on this? i'm in need of this exact same thing