1. #1
    Guest

    Default Approach for filtering

    Approach for filtering


    Hi Jack,

    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?

    TIA,

    Chris

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    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.

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    2
    Vote Rating
    0
    chrisj is on a distinguished road

      0  

    Default


    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?

    Chris

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    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.

    Jack

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    2
    Vote Rating
    0
    chrisj is on a distinguished road

      0  

    Default


    Thanks for the update - I like the direction this is headed.

    Great job!

    Chris

Similar Threads

  1. Having Problem with Filtering the Grid
    By Greeens in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 18 Feb 2007, 1:25 AM
  2. Grid Filtering and Reloading
    By Greeens in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 15 Feb 2007, 10:33 PM
  3. Filtering a grid
    By gfraser in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 29 Jan 2007, 2:58 PM
  4. Grid Filtering / Search
    By prophet in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 17 Jan 2007, 1:01 PM
  5. Filtering grid on the fly
    By techno_adi in forum Ext 1.x: Help & Discussion
    Replies: 12
    Last Post: 13 Oct 2006, 3:13 AM

Thread Participants: 2