javascript - How to change the cell's background color of the ui-grid to some color, if its edited and new value is not equal to the old value (dirty). -
based on help link able achieve color change in solution applies color entire row, not i'm looking for.
i want change color of edited cell. please share if has idea. thanks.
here's plunker example desired behaviour: http://plnkr.co/edit/zfeinxiglqeivfeaqy2y?p=preview
the code block of interest is:
gridapi.edit.on.aftercelledit($scope, function(rowentity, coldef, newvalue, oldvalue) { coldef.cellclass = function(grid, row, col, rowrenderindex, colrenderindex) { if (rowentity.id === row.entity.id && newvalue !== oldvalue) { return "test" ; } return ""; }; $scope.gridapi.core.notifydatachange(uigridconstants.datachange.column);
note "test" class name defined in main.css
.test { background-color: red !important }
edit: here fork of plunker example: http://plnkr.co/edit/ogecjqo8foreisqcufuz?p=preview
Comments
Post a Comment