setting IsDirty field in kendo gantt chart

352 Views Asked by At

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.

1

There are 1 best solutions below

1
On

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