1 回答

TA貢獻2012條經(jīng)驗 獲得超12個贊
有多種方法可以更新 grid 中的單元格值。
1.In 數(shù)據(jù)綁定事件
function Grid_DataBound(e) {
var rows = e.sender.tbody.children();
for (var j = 0; j < rows.length; j++) {
var row = $(rows[j]);
row[0].cells[i].innerHTML = 'Your UpdatedText ';
}
}
2.內(nèi)聯(lián)控件事件(客戶端模板),即您的列需要定義為具有任何控件的 ClientTemplate 并在任何事件上調(diào)用函數(shù)。
function ControlChange(args) {
var currentRow = $(args.currentTarget).closest("tr")[0];
//If needed you can access datasource
var dataItem = $("#Report_Grid").data("kendoGrid").dataItem(currentRow);
currentRow.cells[4].innerHTML = 'Your UpdatedText ';
}
- 1 回答
- 0 關(guān)注
- 165 瀏覽
添加回答
舉報