如何设置nodes中href的url?

发布于 2024-12-08 14:45:31 字数 79 浏览 7 评论 0原文

有谁知道如何设置 jstree 中 links 节点的 href url?

今天是 href="#"

Does anyone know how can I set the href url of the links node in the jstree?

today it's href="#".

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

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

发布评论

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

评论(3

甜心 2024-12-15 14:45:31
$("your-link-selector").attr("href","new-url-you-want");
$("your-link-selector").attr("href","new-url-you-want");
终陌 2024-12-15 14:45:31

您必须进一步澄清您希望对 jstree 应用什么样的更改。
jstree 中的锚点不是真正的锚点,它们的共同目的是更改网页地址,而仅仅是 javascript“单击”事件的诱饵,以便可以执行各种树操作。

You must clarify further, what kind of change you wish to apply to the jstree.
The anchors in the jstree are not true anchors who serve the common purpose of changing a web page address, but are merely baits for javascript 'click' event so that various tree action could be executed.

烟火散人牵绊 2024-12-15 14:45:31

很简单,只需将 data key 更改为对象即可:

    // `data` can also be an object
"data" : { 
    "title" : "The node title", 
    // omit when not needed
    "attr" : {}, 
    // if `icon` contains a slash / it is treated as a file, used for background
    // otherwise - it is added as a class to the <ins> node
    "icon" : "folder"
},

simple, just change the data key to an object:

    // `data` can also be an object
"data" : { 
    "title" : "The node title", 
    // omit when not needed
    "attr" : {}, 
    // if `icon` contains a slash / it is treated as a file, used for background
    // otherwise - it is added as a class to the <ins> node
    "icon" : "folder"
},
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文