KendoUI關於Grid頁面刷新賦值(不修改數據庫)
阿新 • • 發佈:2017-07-27
fresh 修改 png row -1 event var 技術 remove
1.Grid頁面某個字段修改賦值(不用刷新)
var row = GG.data("kendoGrid").select(); var data = GG.data("kendoGrid").dataItem(row); data.set("IP", "1212");
2.Grid刷新
var grid = $("#SearchGrid").data("kendoGrid"); grid.refresh();
3.Grid賦值
var grid = $("#SearchGrid").data("kendoGrid");for (var i = 0; i < data.length; i++) { grid.dataSource.add({ ID: data[i].ID, F_ControllerSN: data[i].F_ControllerSN, IP: data[i].IP, Mask: data[i].Mask, Gateway: data[i].Gateway, MAC: data[i].MAC, MyIP: data[i].MyIP, Remarks: data[i].Remarks, }); }
在指定索引位置插入
grid.dataSource.insert(0, { 監控記錄: event.data });
4.Grid清屏
function Qing() {
var grid = $("#SearchGrid").data("kendoGrid");
var All = grid.dataSource.view();
for (var i = 0; i < All.length; i++) {
grid.dataSource.remove(All[i]);
}
}
KendoUI關於Grid頁面刷新賦值(不修改數據庫)