0

对于 jonmiles treeview 插件,如何在 json 数据中定义默认检查某些节点?

以下内容被完全忽略:

[{
        "text": "Parent 1",
        "checked": true,
        "nodes": [{
                "text": "Child 1",
                "nodes": [{
                        "text": "Grandchild 1"
                    },
                    {
                        "text": "Grandchild 2"
                    }
                ]
            },
            {
                "text": "Child 2"
            }
        ]
    },
    {
        "text": "Parent 2"
    },
    {
        "text": "Parent 3"
    },
    {
        "text": "Parent 4"
    },
    {
        "text": "Parent 5"
    }
]
4

1 回答 1

1

如果您使用,它应该可以工作:

{
    "text": "Parent 1",
    "state": {
        "checked": true
    }
}

你忘了把state财产。作为参考,请查看自述文件中的数据结构

于 2021-05-27T07:06:31.163 回答