Ag-Grid中的行分组

时间:2018-02-16 08:23:39

标签: ag-grid

是否可以在ag-grid中进行行分组并具有与列分组类似的外观: enter image description here

1 个答案:

答案 0 :(得分:0)

您可以参考以下链接 https://www.ag-grid.com/javascript-grid-grouping-headers/

例如: gridOptions.columnDefs = [ { headerName: "Athlete Details", children: [ {headerName: "Name", field: "name"}, {headerName: "Age", field: "age"}, {headerName: "Country", field: "country"} ] }, { headerName: "Sports Results", children: [ {headerName: "Sport", field: "sport"}, {headerName: "Total", columnGroupShow: 'closed'}, {headerName: "Gold", columnGroupShow: 'open'}, {headerName: "Silver", columnGroupShow: 'open'}, {headerName: "Bronze", columnGroupShow: 'open'} ] } ];