PDA

View Full Version : How to refresh an infinite grid?



LesJ
3 Feb 2014, 1:20 PM
I have an infinite grid. How do I programmatically refresh the grid?

Should I loop over the loaded pages and call loadPage for each page in page map?

Ideally, I'd prefer if the grid didn't scroll after the the pages are refreshed.

... just call store.reload() ?

Gary Schlosberg
6 Feb 2014, 12:08 PM
Doesn't the infinite grid load it's own pages as needed? What causes the need for loading pages yourself?

LesJ
6 Feb 2014, 12:22 PM
Doesn't the infinite grid load it's own pages as needed? What causes the need for loading pages yourself?

I have an infinite grid that displays data that changes quite often on the server and it needs to be updated. Users may scroll the grid to a certain point and they expect the grid to be refreshed by clicking a button. I thought I'd have to loop over all cached pages and requested them again, but a simple call store.reload() updated the grid w/o scrolling it.

LesJ
6 Feb 2014, 12:32 PM
Basically, the buffered store reload is smart. It takes into account the fact the store is buffered and it reloads it with the right pages. I'm impressed ;)

http://docs-origin.sencha.com/extjs/4.2.2/source/Store.html#Ext-data-Store-method-reload