0

Kendo を webSQL のような多数の優れたデータ ソースに接続する KendoUI のカスタム トランスポートを作成しています。私の Kendo Grid の問題は、delete/destroy コマンドを実装すると、データ ソース レイヤーがエラーで応答した場合でも、グリッドが実際に行を削除するのを防ぐことができないことです。

RemoteTransport.destroyメソッド経由で呼び出されます。入力パラメーターにはエラーと成功のコールバックが含まれていますが、エラー コールバックを呼び出したり、「false」を返そうとしたり、最終的に拒否する $.Deferred を返そうとしたりしても、グリッド行はなくなります。実際、私が呼ばれる前にそれはなくなりました。

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 に答える