-
12 May 2011 11:35 AM #11
Hm, you're right. With an empty set, you get this error: "Start (0) was greater than end (-1)". Shouldn't be too hard to work around though.
Otherwise, if you have even one row in the set, it works fine, as long as you are returning the correct totalProperty along with your data.
-
12 May 2011 11:40 AM #12
Yeah, Aaron says it's gonna be looked at - the other thing is, it's debug code - look at the comments in the source.
stevil
-
12 May 2011 12:22 PM #13
In the meantime, this override might help:
I've got it working with this. It handles the empty data set as long as the totals are being passed.Code:Ext.override(Ext.data.Store, { onGuaranteedRange: function() { var me = this, totalCount = me.getTotalCount(), start = me.requestStart, end = ((totalCount - 1) < me.requestEnd) ? totalCount - 1 : me.requestEnd, range = [], record, i = start; if (start > end) { me.guaranteedStart = start; me.guaranteedEnd = undefined; me.totalCount = undefined; } else if (start !== me.guaranteedStart && end !== me.guaranteedEnd) { me.guaranteedStart = start; me.guaranteedEnd = end; for (; i <= end; i++) { record = me.prefetchData.getByKey(i); //<debug> if (!record) { Ext.Error.raise("Record was not found and store said it was guaranteed"); } //</debug> range.push(record); } me.fireEvent('guaranteedrange', range, start, end); if (me.cb) { me.cb.call(me.scope || me, range); } } me.unmask(); } });
-
15 May 2011 4:32 AM #14
Yes, I am also getting these strange "it was guarantee" errors, here's my configuration:
With this config and dataset with 200 rows, when I scroll down the grid to its end and then scroll back up to begin, I get "it was guarantee" error (for record with index 1) and infinite loading progress.PHP Code:var _store = Ext4.create('Ext.data.DebugStore', {
model: 'Project',
pageSize: 40,
remoteSort: true,
buffered: true,
proxy: {
type: 'ajax',
url: '/projects/stats',
extraParams: {
project: _projectId,
datebegin: dateBegin,
dateend: dateEnd
},
reader: {
root: 'records',
totalProperty: 'count'
}
},
// autoLoad: true,
folderSort: true,
sorters: ['name'],
simpleSortMode: true
});
_store.guaranteeRange(0, 39);
_grid = Ext4.create('Ext.grid.Panel', {
width: $('project_' + _projectId + '_grid').getSize().x, // using it with MochaUI
height: $('project_' + _projectId + '_grid').getSize().y,// and gray theme
renderTo: 'project_' + _projectId + '_grid',
collapsible: false,
cls: 'x4-nlg',
frame: false,
border: 0,
store: _store,
// also, the summary feature does not work as expected with buffered/paging grids
//features: [summary],
verticalScrollerType: 'paginggridscroller',
loadMask: true,
disableSelection: true,
invalidateScrollerOnRefresh: false,
columns: this._columns
});
-
17 May 2011 9:17 PM #15
I have the same issue. I want to handle it but I meet another problem, When I load my store, in its load event I check if there is count or not then set guaranteeRange. Actingg like this cover "Start (0) was greater than end (-1) error" but "too much recursion" apears in console!
PHP Code:eventGridStore.load();
eventGridStore.on("load", function(){
if (eventGridStore.getTotalCount() == 0) {
Ext.MessageBox.show({
title: 'Information',
msg:'No event!',
icon : 'ext-mb-info',
buttons: Ext.MessageBox.OK
});
}else{
eventGridStore.guaranteeRange(0, ps-1);
}
});
-
18 May 2011 8:52 AM #16
new, this is happening because guaranteeRange IS a load action! When you call guaranteeRange, it enters the load event, and calls guaranteeRange again, and again, and again, etc.
Instead of calling eventGridStore.load(), use eventGridStore.guaranteeRange(0, ps-1). No need for the load event listener.
-
18 May 2011 11:07 AM #17
This workaround should get us to the next release:
stevilPHP Code:Ext.Error.handle = function (err) {
if (err.sourceMethod == "onGuaranteedRange") {
return true;
}
};
-
18 May 2011 8:43 PM #18
-
19 May 2011 4:19 AM #19
-
19 May 2011 4:35 AM #20
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
Similar Threads
-
[OPEN-EXTJSIV-555] Lost Selection in buffered grid.
By Luckyman in forum Ext:BugsReplies: 9Last Post: 28 Nov 2012, 3:00 AM -
[FIXED] Buffered Store with infinite grid - scrolling issues
By gctram in forum Ext:BugsReplies: 14Last Post: 8 May 2012, 6:32 AM -
[OPEN-EXTJSIV-207] Mixins issues
By LesJ in forum Ext:BugsReplies: 3Last Post: 21 Mar 2011, 12:58 PM -
[OPEN-EXTJSIV-205] Numeric axis issues
By vdan in forum Ext:BugsReplies: 1Last Post: 20 Mar 2011, 11:21 PM -
[OPEN-1226] Ext.data.Store and Ext.data.DataReader code and documentation issues
By timbonicus in forum Ext 3.x: BugsReplies: 1Last Post: 20 Aug 2010, 10:34 PM


Reply With Quote
