Skip to content

Instantly share code, notes, and snippets.

@A2H111
Created April 8, 2017 04:35
Show Gist options
  • Save A2H111/c3194b413d188f035d97c1f69631abef to your computer and use it in GitHub Desktop.
Save A2H111/c3194b413d188f035d97c1f69631abef to your computer and use it in GitHub Desktop.
//Method to cancel the edit mode in UIGrid
$scope.cancelEdit = function (row) {
//Get the index of selected row from row object
var index = $scope.gridOptions.data.indexOf(row);
//Use that to set the editrow attrbute value to false
$scope.gridOptions.data[index].editrow = false;
//Display Successfull message after save
$scope.alerts.push({
msg: 'Row editing cancelled',
type: 'info'
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment