hello,
I have students kendo grid in my MVC project with below settings . I’d like to mark dirty flag on the certain cells programmatically. But I didn’t see dirty flag (red triangle on let top corner) on the cell after I run js code. Could someone help me out? Thanks!
.Editable(editable => editable.Mode(GridEditMode.InCell))
.ColumnMenu()
.Resizable(resizable => resizable.Columns(true))
.Pageable(p => p.PageSizes(new int[] {25, 50, 100 }))
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.PageSize(15)
...
Run JavaScript when button click:
$("#markDirty").click(function (e) {
e.preventDefault();
var grid = $("#studentGrid").data("kendoGrid");
var data = grid.dataSource.data();
for (var i = 0; i < data.length; i++) {
if (data[i].ClassName == "MVC") {
data[i].ClassName = "MVC 5.0";
data[i].dirty = true;
}
}
grid.refresh();//didn't see the data change without this line.
});