ui-grid
ui-grid copied to clipboard
is posible undo edits cells?
i don't find anything fot this. can this a new features?
Currently, I guess such feature is not existed. But you can work around it by having a cache-ish object array to store pre-changed values.
[{column: x, row: y, data: data:soemthing}, {column: x: row: y: data:soemthing}].
When data is about to change, put it property to this array, if undo is clicked, revert the data grid cell with the last item from the array.
It works to undo or revert cell edit changes. Just one codeline.
$scope.gridApi.edit.on.afterCellEdit( $scope , function (rowEntity , colDef , newValue , oldValue ) {
rowEntity[colDef.name] = oldValue;
});
It takes the selected column name on the selected row to get the selected cell . Then, it just left to assign old value to that cell.