jsTree 不渲染我的 JSON 数据

发布于 2024-12-05 05:12:10 字数 214 浏览 6 评论 0原文

我正在 ajax 模式下使用 jsTree。

返回的 json 数据采用以下格式:

[{"Name":"David"},{"Name":"Joe"},{"Name":"Leo"},{"Name":"George"},{"Name":"Keith"}]

由于某些原因 jsTree 不会将其呈现为树。

有什么想法吗?

I'm working with jsTree in ajax mode.

The return json data is in the following format:

[{"Name":"David"},{"Name":"Joe"},{"Name":"Leo"},{"Name":"George"},{"Name":"Keith"}]

And for some reason the jsTree doesn't render it as a tree.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小嗲 2024-12-12 05:12:10

imo jsTree 不支持您使用的 JSON 结构。您必须遵循文档中描述的结构 - http://www.jstree.com/documentation/json_data

例如

{
  data : "node1",
  children: [ { data : "node2" } ]
}

imo jsTree does not support JSON structure you use. you have to follow structure described in the dcoumentation - http://www.jstree.com/documentation/json_data

e.g.

{
  data : "node1",
  children: [ { data : "node2" } ]
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文