Removing a Kendo grid row

Author: | Posted in JQuery, Kendo, Learn No comments

Consider a kendo grid with a delete button on each row.

<button ng-click="deleteClick($event)"/>

Step 1 : Get the selected row of the grid where grid is the unique id of the grid.

$scope.getGridCurrentRow = function (event) {  
      return $("#grid").data("kendoGrid").dataItem($(event.target).closest('tr')); 
};

Step 2: Remove the selected row from the grid.

$scope.deleteClick = function (event) {     
      var gridSelectedRow = $scope.getGridCurrentRow(event);     
      $("#grid").data("kendoGrid").dataSource.remove(gridSelectedRow); 
};

Add Your Comment