1

In a simple example like this - https://dojo.telerik.com/UViBAZAP How to mark the field dirty? I want to make changes first and then save at one go.

Edit- I want the field on the UI to show that it was edited. like it does in kendo grid.

genericuser
  • 1,430
  • 4
  • 22
  • 40

1 Answers1

1

You don't need to maintain the dirty field yourself, you just need to ensure that when you modify one of the model objects in the datasource, you use the set method, instead of assigning to it's fields directly.

var task1 = $("#gantt").data("kendoGantt").dataSource.data()[0];
console.log(task1.dirty); // returns false
task1.set("title","Task1 (modified)");
console.log(task1.dirty); // returns true

This way, kendo is aware of the change and marks the object as dirty for you. The datasource will also consider this a change which needs to be sync'd. Hope that helps.

https://dojo.telerik.com/UViBAZAP/2

Joe Glover
  • 994
  • 5
  • 12
  • Right, however the field doesnt show that it was edited, like it happens in kendo grid. It does not append span with k-dirty class to the cell. – genericuser Jun 13 '19 at 18:33