Kendo Asp.net MVC Grid Batch Mode Calculated Column Display does not update

◇◆丶佛笑我妖孽 提交于 2019-12-22 09:43:13

问题


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:


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.



来源:https://stackoverflow.com/questions/24036527/kendo-asp-net-mvc-grid-batch-mode-calculated-column-display-does-not-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!