I have a tree panel and the store associated to it is memory I am loading the data using a loadData function where I am making a call service call. I want to add filters for the columns and filter them remotely when I say remoteFilter : true it is not making a call to the back-end. Any suggestions on how to achieve this.
1 Answers
The code is utter chaos, and shows a lack of understanding of the core concepts of ExtJS. You should clean it up and use the standardized ExtJS ways of doing things whenever possible.
Right now you are trying to put remoteFilter: true
on a store with a memory
proxy. A memory
proxy is not a server proxy, alas does not have a possibility to filter remotely. Adding remoteFilter:true
on that store can only either harm or do nothing.
Then you are loading data into a store with a memory proxy by executing Ext.Ajax.request
manually. By the way, the filters that you wanted to be applied by the server, are not part of your hand-crafted Ajax request.
Usually, one would use store.load
on a store with an ajax
proxy to load a store from a server (this executes Ext.Ajax.request
under the hood, but with all special settings a store supports). In that case, remoteFilter
makes sense insofar as the filters you have set are then submitted to the server, and the server then has to filter out records that should not be displayed client-side. (Let's say it like this, from your front-end code I doubt that the backend supports anything like filtering.)
And then it seems that you are loading data into a tree store that does not come in the format expected by ExtJS. You should look into whether you can craft your model in such a way that the tree store can be directly loaded from the server's response, and get rid of all the intermediate code with Ext.Ajax.request
and reformatting. Since you already have to modify the server side to enable remote filtering, this would be the most futureproof way to get your code working.

- 19,906
- 19
- 75
- 162
-
1Actually, `remoteFilter: true` on a `memory` proxy lets the proxy handle the filtering, instead of the store itself. It is necessary for functional pagination on stores with `memory` proxy. I agree with the rest. You should try to find existing solutions to your problems before creating your own solutions (with problems). – MarthyM Jul 06 '17 at 07:39