Hey guys,
I have a custom rowActions for a relationship which calculate some fields but also set a value on parentView().model i could set the values on parentModel (parentView().mode) but i couldn't save the data on parentView().model: how can i save the parentView().model data from a child relationship custom rowActions below my code:
Thanks
telecastg item emillod
I have a custom rowActions for a relationship which calculate some fields but also set a value on parentView().model i could set the values on parentModel (parentView().mode) but i couldn't save the data on parentView().model: how can i save the parentView().model data from a child relationship custom rowActions below my code:
Code:
actionSetHoldingPaid: function (data) {
var id = data.id;
if (!id) {
return;
}
var model = this.collection.get(id);
var parentModel = this.getParentView().model;
if (!model) {
return;
}
model.set({
holdingStatus: 'Paid',
totalStatus: 'Partially Paid',
});
// Set netSuccessFee on parentView model works fine
parentModel.set('netSuccessFee',
parentModel.get('netSuccessFee') - model.get('holdingFee')
);
this.listenToOnce(model, 'sync', function () {
this.notify(false);
this.collection.fetch();
}, this);
this.notify('Saving...');
// Save parentModel data is not working
parentModel.save();​
model.save();
},​
telecastg item emillod


Comment