如何在Angular Material中

时间:2019-04-04 12:09:06

标签: typescript ag-grid ag-grid-angular

在Angular 7项目中,我有一个采用角材料设计的农业网格。

如何通过拖动列标题中的锚点来调整网格列的大小,例如:https://www.ag-grid.com/javascript-grid-resizing/#resizing-example

这是我的gridOptions:

gridOptions: GridOptions = {
  context: {
    componentParent: this
  },
  floatingFilter: false,
  pagination: true,
  paginationPageSize: 100,
  enableColResize: true,
  cacheBlockSize: 100,
  rowDeselection: true,
  rowSelection: 'multiple',
  domLayout: 'autoHeight',
  defaultColDef: {
    sortable: true,
    resizable: true,
    suppressMenu: true,
    enableRowGroup: true,
  },
  rowGroupPanelShow: 'always',
  suppressDragLeaveHidesColumns: true, // Grouping
  suppressMakeColumnVisibleAfterUnGroup: true, // Grouping
  suppressRowClickSelection: true,
  onGridReady: (params: any) => this.onGridReady(params),
  // onRowDoubleClicked: (event) => this.onRowDoubleClick(event.data),
};

和columDefs看起来像这样:

var colDef: ColDef = {
  field: key,
  headerName: title,
  headerTooltip: title,
  minWidth: 10,
  maxWidth: 250
};

0 个答案:

没有答案