5 Answers, 1 is accepted
0
Hi Aremuga,
The dataSource does not expose a method for checking if there are unsaved changes or not.
Could you please provide more details about your scenario? In case you use a Grid control with batch editing you may check whether there are records with dirty property set to true.
Regards,
Alexander Valchev
the Telerik team
The dataSource does not expose a method for checking if there are unsaved changes or not.
Could you please provide more details about your scenario? In case you use a Grid control with batch editing you may check whether there are records with dirty property set to true.
Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Rayne
Top achievements
Rank 1
answered on 09 Jan 2013, 06:02 PM
Could you post a sample of how this would work?
In my application, I want to use external buttons to do the save/cancel changes and I'd like to alert the user and remind them to save their changes before navigating away from the page. I'd also like to enable/disable the save/cancel buttons depending on whether there are changes that need to be saved or not.
In my application, I want to use external buttons to do the save/cancel changes and I'd like to alert the user and remind them to save their changes before navigating away from the page. I'd also like to enable/disable the save/cancel buttons depending on whether there are changes that need to be saved or not.
0
Hi Rayne,
Basically you have to loop through the dataSource.data() array and check whether there is an item with a dirty property set to true or whether the item is new.
As a general information we plan to provide a build-in hasChanges method in the next release.
All the best,
Alexander Valchev
the Telerik team
Basically you have to loop through the dataSource.data() array and check whether there is an item with a dirty property set to true or whether the item is new.
var
data = dataSource.data();
for
(idx = 0, idx < data.length; idx++) {
if
(data[idx].isNew() || data[idx].dirty) {
return
true
;
}
}
As a general information we plan to provide a build-in hasChanges method in the next release.
All the best,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Achilles
Top achievements
Rank 1
answered on 20 Nov 2013, 05:31 AM
Hi Alexender,
Is the hasChanges method available already ?
If so can you provide a sample just like you had for the dataSource.data() looping mechanism
Thanks in Advance
Achilles
Is the hasChanges method available already ?
If so can you provide a sample just like you had for the dataSource.data() looping mechanism
Thanks in Advance
Achilles
0
Hi Achilles,
Yes, the hasChanges method is now available and is documented here:
Regards,
Alexander Valchev
Telerik
Yes, the hasChanges method is now available and is documented here:
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!