0

I’m having problems with ui-grid cellClass definition. When the grid is first shown, the definitions are right but, if the user scrolls vertically, the wrong class is defined. I’m following the Tutorial example. This is a simplified version of my gridOptions:

this.gridOptions = {
    enableFiltering: true,
    enableColumnMenu: false,
    columnDefs: [{ field: 'D1',
        cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
        if (grid.getCellValue(row,col) > 200) {
          $log.debug(grid.getCellValue(row,col));
          return 'red';
        }
    }}],
    data: myData
};

When the grid is shown, only cells with values above 200 have the red class. However, if the user scrolls, the cellClass function keeps getting called and the red class is randomly attributed, some cells with values bellow 200 have it, some with values above 200 doesn’ t. In the log, I only see values above 200.

I’ m using angular-ui-grid 3.0.0-rc.16

Update 1:

It seems to be a bug in ui-grid component. I was also able to reproduce in the tutorial example. If you go to http://ui-grid.info/docs/#/tutorial/111_cellClass only the Velity company, in the second column, should be blue. However, if you keep scrolling down and up quickly, eventually you will see other cells with blue text.

Update 2: I opened this issue. The problem also happens when you sort the grid.

4

2 に答える 2

1

バグ修正されました。新しい angular-ui-grid コードには、この問題はありません。

于 2014-12-19T20:37:48.350 に答える
0

クラス「.red」の「moduleName.css」ファイルを確認してください。

this.gridOptions = {}

また

$scope.gridOptions = {}
于 2014-11-22T12:50:39.390 に答える