-
29 Aug 2008 8:35 AM #1
Paging Grid / Table with filter?
Paging Grid / Table with filter?
I realized in a paging grid and table it only filters the page it is showing and not query a new result using the filter,
just wondering is there a model of that set up or do that or not.
if not most likely have to make a new textbox that when inputted will query the store for a new type of filter or something. but not sure will that affect the sort orders too.
-
8 Oct 2008 7:05 AM #2
That would essentially be a server side filter. I need this as well. Any ideas out there? Thanks.
-
8 Oct 2008 7:08 AM #3
well I just did some extra textfields to input filters along with the sort and stuff.
-
8 Oct 2008 7:17 AM #4
And how did that solve the problem of server-side filtering?
As I see it, if you have a large number of entries (thousands), you don't want to push them all into the client, so you display things with paging. But when you filter, you do want to filter the whole data set, not only the page being displayed. So you either filter on the server, or you push the whole thing on the client and filter there. But for a large number of entries, this is not practical. Besides, I read in an older post that server-side filtering will be available in 1.1, and now that 1.1 is out, I cannot seem to find it. Any ides on this? Thanks.
-
8 Oct 2008 12:05 PM #5
Grid Filtering
Grid Filtering
To implement more easily this functionality the GXT API should be improved.
Let's explain the main difficulties:
1 - Extend the menu to add the filter item:
You can't extend the menu from a plugin (ComponentPlugin) because menu in GridView is a private member and GridView doesn't provide a getter from it.
Workaround: extend GridView and override createContextMenu, and set the GridView in the Grid after constuction.
2 - Passing the filters as parameters with the rest of the LoadConfig (SortInfo, offset, etc.)
There's no easy way to access the lastConfig associated with the Loader' Store.
WorkAround A: retrieve lastConfig via JSNI (tricky but works)
WorkAround B: subclass BasePagingLoader for instance and store the last config there.
Do anyone has another ideas?
-
8 Oct 2008 12:34 PM #6
well the textbox for fitlering i submit it as more data where on server side i use that string as part of mysql string to do the filters.
-
8 Oct 2008 12:37 PM #7
here is my getorders class header
Code:public GetOrders(PagingLoadConfig config, Integer ordertype, String username, String filtertext, Date filterstartdate, Date filterenddate){
when i make a sql query
Code:mytable.makeTable("SELECT * FROM `orders` WHERE " + wherefield + employeeid + filterstring + filterstartdatetext + filterenddatetext);
Oh ya I coded my own sql wrapper to get results quite easily by putting them into a vector of treemaps
-
8 Oct 2008 12:54 PM #8
@TheBuzzer: I understand that it works, but it's not very extensible because you have to declare all your parameters in your service function.
@Me:
I've found a way to implement it as a plugin more easily:
1- Using HeaderContextMenu event of the Grid it's possible to add MenuItems on the headers' menu.
2 - Using BeforeLoad Event on ListStore or Loader I can't add the parameters in the LoadConfig.
-
8 Oct 2008 4:26 PM #9
well do whatever works for u.
I was just giving a example on how i got server side filtering to work
-
14 Jul 2009 7:37 AM #10
Thought I'd add 2 cents here. A paging grid with server-side filtering would be excellent.


Reply With Quote