gpt4 book ai didi

javascript - 在 ng-grid 中显示层次结构

转载 作者:行者123 更新时间:2023-11-30 17:25:35 27 4
gpt4 key购买 nike

我需要在 ng-grid 的单个列中显示一组分层数据,并使用“+”展开/折叠父行。

我已经查看了它的分组功能,但似乎并没有为我完成这项工作。

我的数据如下:

{
{name: 'Parent 1', children: {}},
{name: 'Parent 2', children: {{name: 'Child 1'}, {name: 'Child 2'}, {name: 'Child 3'}}},
{name: 'Parent 3', children: {}},
}

我希望它在同一列的网格中显示如下:

Parent 1
Parent 2
Child 1
Child 2
Child 3
Parent 3

使用 ng-Grid 实现这一目标的最佳方法是什么?我应该为此使用替代的 json 对象吗?

提前致谢

最佳答案

关于javascript - 在 ng-grid 中显示层次结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24365100/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com