jstree 节点名称
这是我的节点的数据格式:
{
data: "new Structure",
attr: {id:"1", class:"structureNode", rel:"root"}
}
我有相关节点的引用,并且我可以轻松获取属性
nodeReference.attr('attributeName')
但是,我无法访问存储在“数据”中的节点名称。有没有什么方法可以在拥有节点引用的同时访问它(除了在 DOM 中搜索以查找 字段中的文本,我觉得这非常麻烦)?
我也考虑过将名称存储在 attr 数组中,但我不喜欢冗余。
谢谢 :-)
This is the data format for my nodes:
{
data: "new Structure",
attr: {id:"1", class:"structureNode", rel:"root"}
}
I have a reference for the node in question, and I can easily get the attributes
nodeReference.attr('attributeName')
However, I can't get access to the node name, stored in "data". Is there any way to get access to this while having a node reference (other than searching through the DOM to find the text in the <a>
field, which I find very cumbersome)?
I've considered storing the name in the attr array as well, but I don't like to have redundancy.
Thanks :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在文档中找到了解决方案。显然,您所需要的只是
.get_text(nodeReference)
:-)I found the solution in the documentation. Apparently, all you need is
.get_text(nodeReference)
:-)