PDA

View Full Version : Buffered Store, getRange return undefined



mixo
2 Jul 2013, 11:32 PM
Hello guys!
I'm successfully migrate to ExtJS 4.2.1.883 and found many useful changes, faster code execution. But now I have an issue with buffered store when trying to prefetch some data. While data is loading, in extjs grid class function refresh querying viewRange by


94289:records = me.getViewRange();

Then executed getRange function which return undefined (in case of me.rangeCached(requiredStart, requiredEnd) return false) and than it throw exception.


Uncaught TypeError: Cannot read property 'length' of undefined



ext-all-debug.js:94317



94317: if (records.length < 1) {
Is this correct that function getRange can return undefined while expected range of records?

74220: getRange: function(start, end, options) {

...

if (me.rangeCached(requiredStart, requiredEnd)) {

me.onGuaranteedRange(options);
result = me.data.getRange(start, end);
}

else {


me.fireEvent('cachemiss', me, start, end);



pageAddHandler = function(page, records) {

if (me.rangeCached(requiredStart, requiredEnd)) {

me.fireEvent('cachefilled', me, start, end);
me.data.un('pageAdded', pageAddHandler);
me.onGuaranteedRange(options);
}
};
me.data.on('pageAdded', pageAddHandler);





me.prefetchRange(start, end);


}
...


return result;
},

slemmon
4 Jul 2013, 11:16 AM
Any chance you can post a test case to demonstrate the issue you're seeing?

mixo
4 Jul 2013, 11:53 PM
well I develop a desktop-like js interface, this grid is a part of one windowed app and exception depend on window size e.g. count of rows viewed in grid, i considered two cases:
- then viewSize of gird about 16-18 rows error is occured
- then viewSize of gird about 24 and more rows error is NOT occured

my data store config

buffered: true,
leadingBufferZone: 50,
pageSize: 50,
purgePageCount: 0,
proxy:{
type: 'ajax',
url: url_get_alias_list,
reader: {
totalProperty: 'totalCount',
type: 'json',
root: 'items'
}
},

in my example I query 70 rows querySet by two pages(50 and 20 rows)

hope that helps, not shure that I can do a test demo.