New to Kendo UI for jQueryStart a free 30-day trial

Fired when the user clicks the "Save changes" command button in the toolbar.

The event handler function context (available via the this keyword) will be set to the widget instance.

Event Data

e.preventDefault Function

If invoked the grid will not call the sync method of the data source.

e.sender kendo.ui.Grid

The widget instance which fired the event.

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "name" },
    { field: "age" },
    { command: "destroy" }
  ],
  dataSource: {
    data:[
      { id: 1, name: "Jane Doe", age: 30},
      { id: 2, name: "John Doe", age: 33}
    ],
    schema: {
      model: { id: "id" }
    }
  },
  editable: true,
  saveChanges: function(e) {
    if (!confirm("Are you sure you want to save all changes?")) {
       e.preventDefault();
    }
  },
  toolbar: ["save"]
});
</script>
<div id="grid"></div>
<script>
  function grid_saveChanges(e) {
    if (!confirm("Are you sure you want to save all changes?")) {
      e.preventDefault();
    }
  }
  $("#grid").kendoGrid({
    columns: [
      { field: "name" },
      { field: "age" },
      { command: "destroy" }
    ],
    dataSource: {
      data:[
        { id: 1, name: "Jane Doe", age: 30},
        { id: 2, name: "John Doe", age: 33}
      ],
      schema: {
        model: { id: "id" }
      }
    },
    editable: true,
    toolbar: ["save"]
  });
  var grid = $("#grid").data("kendoGrid");
  grid.bind("saveChanges", grid_saveChanges);
</script>
Not finding the help you need?
Contact Support