I'm trying to use the Rally Lookback API with Deft Promises. The code below works with wsapi store, but not the snapshot store. Shouldn't the snapshot store work the same? The error received is: TypeError: Cannot read properties of undefined (reading 'getProxy') How to make this work with the snapshot store?
launch: function() {
Deft.Promise.all([
this.loadRecords('UserStory'),
this.loadRecords('Defect'),
this.loadRecords('TestCase')
]).then({
success: function(recordSets) {
// recordSets = [
// UserStoryRecords,
// DefectRecords,
// TestCaseRecords
// ];
console.log(recordSets);
},
failure: function() {
//Handle error loading the store here...
console.log("Failed.");
}
});
}, // end launch
loadRecords: function(model) {
var deferred = Ext.create('Deft.Deferred');
// Ext.create('Rally.data.wsapi.Store', { // This works!
Ext.create('Rally.data.lookback.SnapshotStore', { // TypeError!!
limit: 'infinity',
model: model,
fetch: ['Name', 'ObjectID'],
autoload: true
}).load({
callback: function(records, operation, success) {
if (operation.wasSuccessful()) {
deferred.resolve(records);
} else {
deferred.reject('Rejected');
}
}
});
return deferred.promise;
},
So it looks like I found the answer, you don't use model in SnapshotStore requests, pass the name of the data store you want to a _TypeHierarchy filter as such. Below appears to work as expected.