-
27 May 2011 10:58 AM #1
infinite-scrolling and buffer-grid examples and reloading with different data
infinite-scrolling and buffer-grid examples and reloading with different data
The examples for infinite-scrolling and buffer-grid only show loading the grid once.
Is there an example somewhere of clearing the grid and loading it with different data?
Before you answer, know that I have tried many things. Simply putting in a removeAll or clearData on the store, and calling cacheRecords and/or guaranteeRange to load it again does not work.
Thanks in advance
right after I posted this, I found the following, and I am trying this out.
http://www.sencha.com/forum/showthre...ia-user-action
-
27 May 2011 12:01 PM #2
Well, I tried the link above with the and it didn't fix my problem. I debugged in guaranteeRange further and found that after onProxyPrefetch calls operation.getRecords, records is "undefined", so when it calls cacheRecords, it bombs when it tries length = records.length.
So, I must have something configured wrong. I'm looking further into this, but if anyone has any suggestions, suggest away.
-
27 May 2011 12:30 PM #3
SOLVED: infinite-scrolling and buffer-grid examples and reloading with different data
SOLVED: infinite-scrolling and buffer-grid examples and reloading with different data
I got it to work. I coded a small sample of my larger project and got it to work. The main key besides doing what rspaeth did, was to make sure to set the store.totalCount before doing the guaranteeRange. I wasn't doing this before. I had it after it.
now I just need to figure out why my larger project still doesn't work, but at least i have somewhere to start.
-
27 Jul 2011 5:00 PM #4
Do you have any update on this?
If you just want to 'reload' a new set of data on param changes or such, can just clear the prefetchedData and call 'prefetchPage(1)'. This would not require you to know the new 'totalCount' which seems to be necessary to make the subsequent guaranteeRange call to work.
I'm still having problem with the vertical scroll bar, it always resets to top when I'm scrolling into the next data fetch.Code:Ext.require('Ext.panel.Table', function(){ Ext.override(Ext.data.Store, { reloadBuffered: function(){ var me = this; me.prefetchData.clear(); delete me.guaranteedStart; delete me.guaranteedEnd; me.totalCount=0; me.mask(); me.prefetchPage(1); } }); });
-
29 Jul 2011 12:13 PM #5
try setting invalidateScrollerOnRefresh to true


Reply With Quote