我知道这已经回答了.但是这个css规则在不需要创建columDefs的情况下完成相同的工作:
.ui-grid-top-panel {
background: black;
color: white;
}
Run Code Online (Sandbox Code Playgroud)
这很简单.只需为您的css添加每个列的headerCellClass.
$scope.gridOptions = {
enableSorting: true,
columnDefs: [
{ field: 'name', headerCellClass: 'white' },
{ field: 'company',headerCellClass:'white'}
],
onRegisterApi: function( gridApi ) {
$scope.gridApi = gridApi;
$scope.gridApi.core.on.sortChanged( $scope, function( grid, sort ) {
$scope.gridApi.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );
})
}
};
Run Code Online (Sandbox Code Playgroud)
这是一个样本
http://plnkr.co/edit/DKi9nSMbI3PG1u8lcHDE?p=preview
| 归档时间: |
|
| 查看次数: |
11207 次 |
| 最近记录: |