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

Undo a row delete in Grid from a RemoteTransport class

1 Answer 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 20 Nov 2012, 08:53 AM
I am trying to create a custom RemoteTransport subclass, that provides WebSQL, IndexedDB and OData V2/V3 compliancy to KendoUI with JayData. 
The thing is almost perfect, only that I am not able to reject a row delete. The user presses the "Delete" grid command, the row disappears, and my code in the RemoteTransport.destroy is not able to restore it anyhow. I can call success and error on the input parameter object, but nothing happens. I tried returning false (can not work in async mode) or tried returning a promise and rejecting that but these did not help either.

Calling grid.cancelChanges is not an option for me, as  my code runs in the data layer and has no knowledge of UI controls.

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 23 Nov 2012, 01:57 PM
Hi Peter,

By default unsuccessful changes are re-submitted through the transport, not reset.

Calling the operation.error method will cause the error event of the DataSource to fire. My recommendation is to catch that event and cancel the changes on it.
For convenience I prepared a small example that demonstrates the approach.

Kind 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!
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or