This is a migrated thread and some comments may be shown as answers.

Dirty Flag Reset

2 Answers 553 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 10 Mar 2017, 09:22 AM

Hi,

I have a datasource attached to a Kendo spreadsheet with AngularJS.

In the onchange method of the spreadsheet, we iterate datasource.data() to see which records are changed. I then use a webservice (not the transport layer of the datasource) to validate the changes.

The user can then choose to press a save button, which will use a webservice (not the transport layer) to save the records. However, after the datasource has iterated the data to run the validation specified above, all the records dirty flags are set back to false. I have tried in this same loop the following, to reset the dirty flag but it doesn't seem to work.

datasource.data()[i].dirty = true;

Thanks

Marc

2 Answers, 1 is accepted

Sort by
0
Accepted
Niko
Telerik team
answered on 13 Mar 2017, 04:39 PM

Hello Marc,

The call for the data of the DataSource does not change the dirty flags. Please, check the following dojo as an example - dojo.telerik.com/AbirEQ. Please, note that a call to the sync method would reset the flags.

You could update the provided dojo with the setup that causes the described behavior. This will make it easier to check what is causing this effect.

Regards,
Niko
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Marc
Top achievements
Rank 1
answered on 13 Mar 2017, 04:41 PM

Hi Niko,

Thanks!

It was my fault. I was (stupidly) updating the datasource by using datasource.read() instead of just updating the singular record inside the datasource.

Thanks again!

Marc

Tags
Data Source
Asked by
Marc
Top achievements
Rank 1
Answers by
Niko
Telerik team
Marc
Top achievements
Rank 1
Share this question
or