I have a grid with several computed columns.I set the computed properties when I change the properties in the grid edit mode . Do I need to use editor template to make a read only column (when I set editable:false it doesn't change according to the new value)?
And I have several computed properties in grid, Is there any other way to make it a generic calculation instead of using if/else for change property name like this,
Is there any event like saved (to get the data.model with changed property has been set)?
And the other issue is when I have several computed fields set like this the save method is called for each calculated field set.
Here is my example,
http://jsfiddle.net/H6tgv/74/
And I have several computed properties in grid, Is there any other way to make it a generic calculation instead of using if/else for change property name like this,
save: function(data) {
if (data.values.Qty) {
var test = data.model.set("Total", data.values.Qty * data.model.Amt);
}
else {
var test = data.model.set("Total", data.model.Qty * data.values.Amt);
}
}
if (data.values.Qty) {
var test = data.model.set("Total", data.values.Qty * data.model.Amt);
}
else {
var test = data.model.set("Total", data.model.Qty * data.values.Amt);
}
}
And the other issue is when I have several computed fields set like this the save method is called for each calculated field set.
Here is my example,
http://jsfiddle.net/H6tgv/74/