0

I am creating a custom transport for KendoUI that would connect Kendo to a number of cool data sources like webSQL. My Kendo Grid problem is that when I implement the delete/destroy command I am not able to prevent the grid from the actual remove row to happen, even if the data source layer has responded with an error.

I get called via the RemoteTransport.destroy method. The input parameter contains an error and a success callback, but even if I call the error callback, or try to return a "false", or try to return a $.Deferred that I eventually reject: the grid row is gone. Actually it's gone before I get called.

4

1 回答 1

1

I believe you would want the cancelChanges method on the grid.

http://docs.kendoui.com/api/web/grid#cancelchanges

A response from the KendoUI forum helps decoupling the UI part from the data layer part

In the RemoteTransport call the rejection handler this will cause an exception in the DataSource. In the DataSource definition place an error handler that call the actual cancelChanges or whatever rollback method the control will have. Still inperfect - but at least doable.

于 2012-11-19T17:47:32.210 回答