[英]React ag-grid group by row
I was reading ag-grid documentation and I was wondering is it possible to group by row instead of column? 我正在阅读农业网格文档,我想知道是否可以按行而不是按列分组?
I know you simply need to put rowGroup: true
on the column but what if I want to do a custom row group. 我知道您只需要将
rowGroup: true
放在列上,但是如果我想执行自定义行组该怎么办。
this.state = {
columnDefs: [{
headerName: "Make", field: "make"
}, {
headerName: "Model", field: "model"
},{
headerName: "Price", field: "price"
}],
rowData: [{
make: "Toyota", model: "Celica", price: 35000
},{
make: "Ford", model: "Mondeo", price: 32000
}]
}
From the example if my data brings back two row category "Toyota" and "Ford" and I want to only group "Ford" row. 从示例中,如果我的数据返回两行类别“ Toyota”和“ Ford”,而我只希望对“ Ford”行进行分组。 How can I achieve this?
我该如何实现?
Make |Model
_______
Toyota
_______
v Ford
Mondeo....
Visual representation of the table I would like to achieve. 我要实现的表的可视化表示。
If I understand you correctly, you are for master detail rows: 如果我对您的理解正确,则适用于主要明细行:
https://www.ag-grid.com/javascript-grid-master-detail/#example-simple-master-detail https://www.ag-grid.com/javascript-grid-master-detail/#example-simple-master-detail
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.