dontbannedmeagain
dontbannedmeagain

Reputation: 480

Kendo UI Grid Inline get SUM value

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);
}

WORKING DEMO

Upvotes: 1

Views: 194

Answers (1)

i.signori
i.signori

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

Related Questions