Reputation: 480
I had this inline editing grid. What I want to achieve went I enter a value in basePax
and extraBedAllow
, maxPax
will get the SUM value of both data.
I use edit event but seem not working
edit: function(e) {
var E1 = parseInt(e.model.basePax);
var E2 = parseInt(e.model.extraBedAllow);
var EX = E1 + E2;
e.model.set("maxPax", EX);
}
Upvotes: 1
Views: 194
Reputation: 595
Try to use the jQuery change function inside the edit. Like this
edit: function(e) {
$("[name='basePax'],[name='extraBedAllow']").change(
function(){
var E1 = parseInt(e.model.basePax);
var E2 = parseInt(e.model.extraBedAllow);
var EX = E1 + E2;
e.model.set("maxPax", EX);
});
}
Upvotes: 1