jsTree:如何检索“元数据”?

发布于 2024-12-03 02:02:30 字数 144 浏览 8 评论 0原文

我尝试了这个示例,但仍然存在问题 - 我可以没有获得“元数据”值。有人可以再举一个例子吗?

I tried this example, but there is still a problem - I could not get 'metadata' value. Could somebody show one more example?

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

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

发布评论

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

评论(1

亽野灬性zι浪 2024-12-10 02:02:30

这个例子对我来说工作得很好,版本 1.0-rc3

这是另一个:

{
    'attr': {'id': 'example1'},
    'data': {
        'attr': {
            'href': '#'
        },
        'title': 'Example'
    },
    'metadata': {
        'hello': 'world'
    }
}

并检索元数据:

$(node).data('hello'); // world

That example is working fine for me with version 1.0-rc3

Here's another:

{
    'attr': {'id': 'example1'},
    'data': {
        'attr': {
            'href': '#'
        },
        'title': 'Example'
    },
    'metadata': {
        'hello': 'world'
    }
}

And to retrieve the metadata:

$(node).data('hello'); // world
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文