PDA

View Full Version : Local filter on a large client-side dataset with infinite scrolling or paging



mberrie
16 Oct 2012, 11:03 PM
I am implementing a 'live' filter on a grid - meaning it filters the grid as the user types the search term into a textfield. My current approach is to pull the whole dataset to the client (about 2000 words/phrases) once and filter locally.
This is implemented and works nicely.

However, currently the grid renders the entire result set to the DOM which will be a problem on slower clients (IE...).

I want to limit the number of rendered rows to ease the burden on the browser's rendering engine.
The user should still be able to browse all matches - either via paging, or infinite scrolling.

Looking into this I could think of solutions involving a PagingMemoryProxy or infinite scrolling or directly on a buffered store. Seems that neither of these support local filtering out of the box.

The main problem is that the store only filters on the loaded data - that is the current page.

So I could either implement a 'filter' method that filters data in the PagingMemoryProxy, or do something similar for infinite scrolling.
Both approaches are surely doable but I was hoping for a solution with less lines of code :)

It would also be interested to hear if others actually followed one of these approaches, or maybe found a better one?

My backup strategy is to use a simple Ext.view.View that only renders the first x records, and adds a link to 'show all'.

I am thankful for any feedback/advice!

mberrie
17 Oct 2012, 8:08 PM
Any feedback on this? I know it is late evening now in some parts of the world :)

mberrie
19 Oct 2012, 9:04 AM
OK, my last effort to bring attention to my question. Hopefully more people will see it at this time of the day.