使用ag网格企业版实施扩展或折叠

问题描述 投票:0回答:1

我正在尝试将at grid更改为ag grid。我正在使用企业版。数据结构如下:

let data=[
  { name: "T-001", attribute: "VOL", plantValue: 71, scheduleValue: 71, baselineValue: 71, newBaselineTime: "2020-01-17T08:30:00+08:00", id: "~7d428201009c3318060a0000" },
  { name: "T-001", attribute: "Amenam", plantValue: 72, scheduleValue: 71, baselineValue: 71, newBaselineTime: "2020-01-17T08:30:00+08:00", id: "~7d428201009c3318060a0000" },
  { name: "T-001", attribute: "Arab Light", plantValue: 71, scheduleValue: 71, baselineValue: 71, newBaselineTime: "2020-01-17T08:30:00+08:00", id: "~7d428201009c3318060a0000" },
  { name: "T-002", attribute: "VOL", plantValue: 21, scheduleValue: 71, baselineValue: 71, newBaselineTime: "2020-01-17T08:30:00+08:00", id: "~bb4a8201009c3318060d0000" },
  { name: "T-002", attribute: "Amenam", plantValue: 45, scheduleValue: 71, baselineValue: 71, newBaselineTime: "2020-01-17T08:30:00+08:00", id: "~bb4a8201009c3318060d0000" },
  { name: "T-002", attribute: "Arab Light", plantValue: 54, scheduleValue: 71, baselineValue: 71, newBaselineTime: "2020-01-17T08:30:00+08:00", id: "~bb4a8201009c3318060d0000" },
];

是否可以使它像这样:grid picture。因此,列[[<< tank可以像在at grid中一样的容器名称扩展或折叠。由于tank具有相同的名称,因此我使用了树数据功能,但这不起作用。但是,按列[[tank分组并不像原始的at [网格]。树数据或组都不适合我。

let gridOptions= { treeData: true, groupDefaultExpanded: -1, getDataPath: function(data) { return data.orgHierarchy; }; autoGroupColumnDef:{ headerName: 'Tank', tooltipField:"name", pinned: true, lockPosition: true, headerCheckboxSelection: true, headerCheckboxSelectionFilteredOnly: true, checkboxSelection: true, cellRendererParams: { suppressCount: true },
javascript ag-grid
1个回答
0
投票
但是,这将创建一个附加的组列,并显示名称列。因此,您必须通过设置hide : true隐藏您的“名称”列。

最后,您可以自定义组列以具有自定义名称,并将其传递给gridOptions

autoGroupColumnDef:{ headerName: 'Tank', tooltipField:"name", pinned: true, lockPosition: true, headerCheckboxSelection: true, headerCheckboxSelectionFilteredOnly: true, checkboxSelection: true, cellRendererParams: { suppressCount: true } },

© www.soinside.com 2019 - 2024. All rights reserved.