Kendo Asp.net MVC网格批处理模式计算的列显示不更新 [英] Kendo Asp.net MVC Grid Batch Mode Calculated Column Display does not update
问题描述
在Ajax批处理模式下使用Kendo Asp.net MVC网格.
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?
推荐答案
更改了计算语句(请参见下文),并且所有相关的列在移出焦点后立即开始反映更改.
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.
这篇关于Kendo Asp.net MVC网格批处理模式计算的列显示不更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!