-->

Wrapping words in the ng-grid's header

2019-08-27 18:48发布

问题:

I've got pretty long column titles in my ng-grid and trying to wrap words there. I've been dancing around custom 'headerCellTemplate' for some time and now words are wrapped, but I can't reach the adequate header height. I guess it coming from the 'overflow' CSS property, but all my efforts about it were failed.

Is there an easy way to wrap these words?

Here is the plunker: http://plnkr.co/edit/TnK8pl?p=preview

回答1:

Just set the headerRowHeight in gridOptions:

    $scope.gridOptions = { 
      data: 'myData', 
      enableRowSelection: false,
      columnDefs: 'gridColumns',
      headerRowHeight: 50
    };

Forked Plunker