带有垂直滚动的ng-grid wrap-text行

时间:2016-03-02 01:28:30

标签: angularjs

我有一个ng-grid,我正在尝试为包含多行注释文本的列创建一个wrap-text列。我今天一直在尝试在互联网上找到的所有东西,但仍无法找到解决方案。我想告诉你我的代码,如果有人能告诉我一个更好的方法,这将是一个很大的帮助。

var vm = this;

$scope.gridOptions = {
  data: 'myData',
  enablePaging: true,
  pagingOptions: $scope.GridPagingOptions,
  sortInfo: {
    fields: [],
    columns: [],
    directions: []
  },
  useExternalSorting: false,
  showFooter: false,
  columnDefs: [{
    field: 'RequestNumber',
    width: 90,
    displayName: 'RequestID'
  }, {
    field: 'ActionByName',
    width: 160,
    displayName: 'Action  },      { field: '
    ActionDate ', width: 90, displayName: Action Date',
    cellFitlter: "date:'yyyy-MM-dd'"
  }, {
    field: 'Comments',
    width: 125,
    displayName: 'Comments'
  }, {
    field: 'ApproverComments',
    displayName: 'Approver Comments',
    rowHeight: 25,
    width: 215,
    cellClass: 'wrap-text',
    cellTemplate: '<label id="approverC" name="approverC" title="{{ row.getProperty(col.field)}}">{{ row.getProperty(col.field)}}</label>'
  }]

};
.gridStyle4 {
  border: 1px solid #dfdfdf;
  overflow-y: scroll;
}
<div style="margin-top:100px;">
  <hr style="height:1px; background-color: silver; border:0px; margin-top:0px; margin-bottom:10px;" />
  <div class="gridStyle4" ng-grid="gridOptions" />
</div>

0 个答案:

没有答案
相关问题