Within my ng-grid, each row contains a button for editing and canceling. When the edit button is clicked, the data in the row can be modified. However, if I decide not to save the changes, I can simply click the cancel button. To achieve this behavior, I make use of the following AngularJS code snippet:
angular.copy(row.entity,$scope.data);
After making some edits to the data, I realize that I want to discard them and revert back to the original values. In such cases, clicking the cancel button should restore the grid to its original state. Could someone please advise on how to implement this functionality?