现在在做一个项目,要弄收藏夹,数据库表结构是:id,当前节点,父节点。怎样才能查询出类似于
[
{
title: 'parent 1',
expand: true,
disabled: true,
children: [
{
title: 'parent 1-1',
expand: true,
children: [
{
title: 'leaf 1-1-1',
expand: true
},
{
title: 'leaf 1-1-2',
expand: true
}
]
},
{
title: 'parent 1-2',
expand: true,
children: [
{
title: 'leaf 1-2-1',
expand: true
},
{
title: 'leaf 1-2-1',
expand: true
}
]
}
]
这种结构的数据?
项目:JFinal