ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

cellClass function not called when cell data changes

Open dpwegener opened this issue 9 years ago • 5 comments

If the data in a cell changes, the cellClass function is not called to update the class of the cell. The cell styling doesn't change until something forces the call such as sorting the table.

I am attempting to update cell data as it is updated from a message coming in over a websocket. The data in the table is updated and displayed. However, the cellClass function isn't called for the updated cell so the styling doesn't change.

I have recreated an example in the below plunker. If you click on the Change Velity button, the company text for the 3rd entry is changed to Aaaaaa but the text remains blue. Clicking on the column heading to sort the collumn displays the text as normal. Clicking the button again returns the company name to Velity. The text doesn't change back to blue. You have to sort the table to get the text to change back to blue. Plunker demonstrating problem

dpwegener avatar Nov 16 '16 02:11 dpwegener

you need to add $scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL); to your $scope.swap function

B00TMan avatar Nov 17 '16 16:11 B00TMan

Calling notifyDataChange will force the wanted behavior but at the cost of re-evaluating the entire grid data. The grid is able to realize that the data has changed without calling the notifyDataChange function. It should also realize that it needs to call the cellClass function.

dpwegener avatar Nov 17 '16 23:11 dpwegener

Any chance this gets resolved soon...? It looks like another big problem.

inad9300 avatar Jun 26 '18 09:06 inad9300

Did this issue ever get resolved? Having same issue

itdeveloper007 avatar Oct 02 '18 15:10 itdeveloper007

Hi.. any Updates for This?

jeimz143 avatar Dec 06 '19 14:12 jeimz143