PDA

View Full Version : Remote filter for Grid with 10,000+ rows?



rlaferla
12 Aug 2009, 6:59 AM
I have a Grid that can contain tens of thousands of rows. Instead of fetching all the rows and letting the user filter them down to a manageable set, I'd like them to be filtered server-side. i.e. There would be a StoreFilterField on the client. The user would start typing the letter 'a' and the server would fetch all records starting with 'a' and send those back to the client. This would be better than sending ALL the records back and then filtering them on the client.

What's the recommended way to do it?

Arno.Nyhm
12 Aug 2009, 7:53 AM
something like this in ExtJs?

http://extjs.com/forum/showthread.php?p=372673

rlaferla
12 Aug 2009, 7:58 AM
I'm not sure I understand that patch. I don't think it would be useful to me because I am working in Java. Is there a Java / GXT equivalent?

sven
12 Aug 2009, 8:01 AM
You could actually just use a normal textfield and setup a keylistener on that. When the user presses a key you make the serverrequest to fetch the data.

Arno.Nyhm
12 Aug 2009, 8:13 AM
i just dig into it. there is only possible to set a remote sort in the loader.
im not so familar with the stores etc.
one idea would be to change the loadconfig of a loader and reload the store!?
maybe in the loadconfig you can set your own parameters.

maybe someone else has better ideas

sven
12 Aug 2009, 8:30 AM
No that would be the way to go. The keylistener would change the loadconfig and add another parameter (for example filterBy). Than the server would get the loadconfig, check the parameter and only return the valid data.

Arno.Nyhm
12 Aug 2009, 8:48 AM
@sven: thx

for example HttpProxy use the loadconfig and send all to the server:
http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/data/HttpProxy.html

the BaseListLoadConfig is like a normal ModelData where you can set and get properties
http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/data/BaseListLoadConfig.html