File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 22
22
//$elm.addClass($scope.col.getColClass(false));
23
23
$scope . grid = uiGridCtrl . grid ;
24
24
25
- $elm . addClass ( $scope . col . getColClass ( false ) ) ;
25
+ var initColClass = $scope . col . getColClass ( false ) ;
26
+ $elm . addClass ( initColClass ) ;
26
27
27
28
// apply any footerCellClass
28
29
var classAdded ;
46
47
updateClass ( ) ;
47
48
}
48
49
50
+ // Watch for column changes so we can alter the col cell class properly
51
+ $scope . $watch ( 'col' , function ( n , o ) {
52
+ if ( n !== o ) {
53
+ // See if the column's internal class has changed
54
+ var newColClass = $scope . col . getColClass ( false ) ;
55
+ if ( newColClass !== initColClass ) {
56
+ $elm . removeClass ( initColClass ) ;
57
+ $elm . addClass ( newColClass ) ;
58
+ initColClass = newColClass ;
59
+ }
60
+ }
61
+ } ) ;
62
+
49
63
// Register a data change watch that would get triggered whenever someone edits a cell or modifies column defs
50
64
var dataChangeDereg = $scope . grid . registerDataChangeCallback ( updateClass , [ uiGridConstants . dataChange . COLUMN ] ) ;
51
65
You can’t perform that action at this time.
0 commit comments