I'm facing a challenge in setting the parent for multiple features that I've copied for a specific MMF. However, only the parent of the last feature is being set.
Below is the code snippet responsible for setting the parent: Record represents the new feature object _newParent refers to the MMF object where the issue occurs
record.set("Parent", _newParent.get("_ref")),
I could really use some help here. Any suggestions?
The entire method looks like this:
_genericInnerCopy: function(_childObj) {
that = this;
model = that.model;
var record = Ext.create(model, {
Name: _childObj.get('Name'),
//Parent: _newParent.get("_ref");,
});
record.save({
callback: function(result, operation) {
if(operation.wasSuccessful()) {
console.log("Done");
//that._copyChild();
} else {
console.log("error");
}
}
})
that._all_pis.push(record);
console.log("all pis values", that._all_pis);
var store = Ext.create('Rally.data.custom.Store', {
data: that._all_pis,
listeners: {
load: that._updateAll,
scope: that
},
});
//console.log("record values", that._all_pis);
},
_updateAll: function(store,data) {
console.log("store values", store);
console.log("data values", data);
Rally.data.BulkRecordUpdater.updateRecords({
records: data,
propertiesToUpdate: {
Parent: _newParent.get("_ref")
},
success: function(readOnlyRecords){
//all updates finished, except for given read only records
},
scope: that
});
//that._createNewItems(that._all_pis);
},