admin管理员组文章数量:1336631
I have an AgGrid configured with the following column definitions:
const colDefs = ref([
{
field: "make"
},
{ field: "model" },
{
headerName: "Col Group",
columnGroupShow: "open",
children: [{ field: "price" }, { field: "electric" }],
},
]);
As you can see, I have configured a column group named "Col Group" and according to AgGrid documentation, there should be an option to collapse and expand the group, but I don't see it in my grid.
Here's a working example
Am I missing something or doing something wrong? How can I have the collapse/expand options working for this column group?
I have an AgGrid configured with the following column definitions:
const colDefs = ref([
{
field: "make"
},
{ field: "model" },
{
headerName: "Col Group",
columnGroupShow: "open",
children: [{ field: "price" }, { field: "electric" }],
},
]);
As you can see, I have configured a column group named "Col Group" and according to AgGrid documentation, there should be an option to collapse and expand the group, but I don't see it in my grid.
Here's a working example
Am I missing something or doing something wrong? How can I have the collapse/expand options working for this column group?
Share Improve this question asked Nov 20, 2024 at 10:38 gespinhagespinha 8,49717 gold badges59 silver badges95 bronze badges1 Answer
Reset to default 0You need to set the columnGroupShow
field on the children, not on the column def itself. Here is your updated code:
const colDefs = ref([
{
field: "make",
},
{ field: "model" },
{
headerName: "Col Group",
children: [{ columnGroupShow: "open", field: "price" }, { columnGroupShow: "closed", field: "electric" }],
},
]);
本文标签: javascriptHow to make Column group expandcollapse work in AgGridStack Overflow
版权声明:本文标题:javascript - How to make Column group expandcollapse work in AgGrid? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742364494a2461012.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论