3
votes

Using Kendo Asp.net MVC Grid in Ajax Batch Mode.

Having three columns - Qty, Rate, Total. Need to achieve real-time calculation on change. Written following function to update data.

function grid_change(e) {
    if (e.action === "itemchange") {
        var item = e.items[0];
        item.Total = item.Qty * item.Rate;
    }
}

But the column does not reflect the calculated value until focus is moved over it. How to update / refresh the cell display as soon as the change event is completed?

1

1 Answers

5
votes

Changed the calculation statement (see below) and all the related columns started reflecting changes immediately after the focus was moved out.

function grid_change(e) {
    if (e.action === "itemchange") {
        var item = e.items[0];

        item.set("Total", item.Qty * item.Rate); // Changed to this
    }
}

Note: The columns that you are going to update at real-time must be editable.