In angular ui-grid, I need to set the cellClass of specific cells based on their value. To determine what the cell class should be, I need to make a rather expensive http lookup, and therefore need to make my cellClass function return a promise. However it doesn't look like ui-grid waits for the promise to resolve, as the cellClass doesn't get applied. Is it not possible or am I doing it wrong. This function is to illustrate was I need to happen. Ofcourse this would be a $http call instead of a $timeout:
function cellClassDeferred() {
var defer = $q.defer();
$timeout(function() {
defer.resolve('yellow');
}, 3000);
return defer.promise;
}
I've created a plunker to show my intension: http://plnkr.co/edit/HqlT4lpQZ5BA2pWjxIL0?p=preview