kendo-uikendo-grid

Kendo Grid cancel edit event


I'm using the edit event on a Kendo grid to show a couple of hidden columns. I'll then hide them again on the save event.

Problem I have is that there doesn't appear to be an event for cancelling edit mode, so the column get screwed up if the user clicks cancel.

Is there an undocumented event for cancel or do I need to find a workaround?


Solution

  • Basically there is no such "Cancel" event, however you can attach click event on the "Cancel" button in the еdit event of the Grid. Please check the example below:

    function onEdit(e) {
       e.container.find(".k-grid-cancel").bind("click", function () {
          //your code here
       })
     }
    

    EDIT: From some time the Grid have "cancel" event which can be used instead of the above solution: