Kendo mvc 刷新单元格值

我正在尝试使用 javascript 刷新网格单元格。我指的是我想刷新的两个单元格,但命令 refresh() 或 read() 不起作用:

http://img4.mukewang.com/60f2889e0001e0ac08630154.jpg

http://img.mukewang.com/60f288a50001c50408620122.jpg


慕妹3146593
浏览 146回答 1
1回答

繁花如伊

有多种方法可以更新 grid 中的单元格值。1.In 数据绑定事件function Grid_DataBound(e) {&nbsp; &nbsp; var rows = e.sender.tbody.children();&nbsp; &nbsp; for (var j = 0; j < rows.length; j++) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var row = $(rows[j]);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; row[0].cells[i].innerHTML = 'Your UpdatedText ';&nbsp; &nbsp; }}2.内联控件事件(客户端模板),即您的列需要定义为具有任何控件的 ClientTemplate 并在任何事件上调用函数。function ControlChange(args) {&nbsp; &nbsp; &nbsp;var currentRow = $(args.currentTarget).closest("tr")[0];&nbsp; &nbsp; &nbsp;//If needed you can access datasource&nbsp; &nbsp; &nbsp;var dataItem = $("#Report_Grid").data("kendoGrid").dataItem(currentRow);&nbsp; &nbsp; &nbsp;currentRow.cells[4].innerHTML&nbsp; = 'Your UpdatedText ';}
打开App,查看更多内容
随时随地看视频慕课网APP