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.
Also, If I set the field value, the field should be marked dirty, for the user to know it was changed. Is there any way to achieve this?
4 Answers, 1 is accepted
Thank you for the provided Dojo example. Below is a code snippet which could be used to add “dirty-field” class to the edited by the user task fields. This snippet will be executed on every save event in the Gantt component:
To mark the newly added tasks we could use the below code on every add event:
Here is a modification of the provided Dojo. In this demo, the modified fields are being set with a red background. The desired "dirty" indication could be set by changing the "dirty-field" CSS class.
Please check the above Dojo and let me know if you have questions regarding the implementation or need further assistance.
Regarding your second question, the Gantt component is designed to save the changes in the existing events when the “save” button in the “Task” popup window is pressed and add the new tasks directly when the “Add Task” button is clicked. This is about to say that the asked functionality for saving all new changes at once is not a supported one.
Based on the provided information, I would suggest that the desired functionality is to have a red triangle added to the modified tasks in a Gantt chart - the same triangles which are added when a .k-dirty class is added to a Grid cell. The .k-dirty class cannot be used in Gantt, but we can define a new class which is formatting the DOM in a similar way as it.
Based on my previous Dojo, here is a new one, demonstrating the described above functionality.
The marked in yellow selectors are selecting the wrapper element of the Tasks inside the Gantt and add the dirty-field CSS class to them.
The CSS defining the dirty-field class style is:
Please, check the provided Dojo and the description above and let me know if the proposed solution is the one you are looking for.
If you have any further questions, please let me know