同时,这是一个使用“loadPage”函数代替“load”的解决方案:
var allRecords = [];
function getWorkItems(pageNumber) {
Ext.create('Rally.data.lookback.SnapshotStore', {
fetch : ['Name','ObjectID','PlanEstimate'],
filters : [{
property : '__At',
value : 'current'
},{
property : '_TypeHierarchy',
value : 'HierarchicalRequirement'
},{
property : 'Children',
value : null
}]
}).loadPage(pageNumber, {
params : {
compress : true,
removeUnauthorizedSnapshots : true
},
callback : function(records, operation, success) {
allRecords = Ext.Array.merge(allRecords, records);
if (operation.response.StartIndex + operation.response.PageSize >= operation.response.TotalResultCount) {
//All records loaded
} else {
getWorkItems(++pageNumber);
}
}
});
}(1);