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

Leave Page = Leave Changes

1 Answer 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 09 Feb 2012, 09:13 PM
We would like a function that warns before leaving a page with changes. Is there a way to do this through the Kendo Data? Can we check for dirty data?

Thanks

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 13 Feb 2012, 11:13 AM
Hi John,

Generally speaking there is no such method. To achieve it you will need keep track of any changes made to the Grid. You can hook functions to the 'remove' and 'edit' events which turn on global flags which indicate if you have made any changes.
Also if you want to check if a partucular object has any changes you can use the following dataSource method.
$('#grid').data('kendoGrid').dataSource.get(7).hasChanges()
where 7 is the index of your item in the dataSource.

Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or