8 Sep 2006 9:55 AM #1
Approach for filtering
Approach for filtering
Great stuff! I have a new Rails project that I am evaluating this grid for and it meets most of my criteria. I am curious as to how easily it would be for me to apply filters dynamically.
Most of the grids I will be using in this app will need to allow the user to (somehow) filter the grid results by some criteria. I'm not interested in anything particularly fancy; I'm more interested in your thoughts as to the best approach. As the underlying data is disconnected from the grid, it makes sense that it could be filtered and the connection to the grid reset. Would you approach it that way? Or would you consider filtering the data on the client side to be a better approach?
8 Sep 2006 11:05 AM #2
It depends on the implementation. Most of the data I feed into a grid is fed by a query, so I generally filter on the server side.
If you have a filter form, you can override the onsubmit (like I did in the feed viewer URL form) and call load() on the DataModel passing a URL and your filter parameters to the server to create a new XML document (or JSON data if you are using the JSONDataModel).
Filtering on the server is more flexible and SQL has alot more query/filtering options than we can really do in JS but if you really needed to do client-side filtering it could be done. I would just loop through all of the rows in the DataModel, test to see if it should be filtered and call removeRows with the filtered rows. I can't say how fast it would be, it depends on the data/the filtering complexity.
By the way, this post gave me an idea for something missing in the LoadableDataModel. Along with the load() method, there should be a loadForm() method to take a form and post it automatically.
8 Sep 2006 12:05 PM #3
That makes sense. I can certainly resubmit with filter criteria and get a fresh set of data.
That reminds me...
Taking a step back, let me ask a higher level question.
If you compare this grid component to, say, the Rico LiveGrid, there is an element of that grid where it grabs data aynchronously from a web service only when it needs to do so. This enables the LiveGrid to manage (or give the appearance of managing) hundreds, if not thousands of rows of data.
This grid (at least on the surface) seems to be oriented toward getting an entire "set" of data at once. Is that how you would characterize it? Or am I missing something?
8 Sep 2006 3:19 PM #4
Yes, this first version doesn't automatically handle remote datasets. It's #2 on the list though, so it should be available soon.
The OpenRico grid is great at what it does, which is display lots of data with a small footprint. My goal was a little different - to build a full featured interface, not just a standard table, then add more things like remote datasets.
#1 on the list is built-in editing support and it is about 80% complete. It is coming along real well and I am hoping to have a test version to put up within the next week. After that I will start working on the remote datasets.
8 Sep 2006 5:26 PM #5
Thanks for the update - I like the direction this is headed.
By Greeens in forum Ext 1.x: Help & DiscussionReplies: 5Last Post: 18 Feb 2007, 1:25 AM
By Greeens in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 15 Feb 2007, 10:33 PM
By gfraser in forum Ext 1.x: Help & DiscussionReplies: 6Last Post: 29 Jan 2007, 2:58 PM
By prophet in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 17 Jan 2007, 1:01 PM
By techno_adi in forum Ext 1.x: Help & DiscussionReplies: 12Last Post: 13 Oct 2006, 3:13 AM