在 Struts2-dojo 树控件中显示图标
因此,我有一个 Struts2.1.8 应用程序,我想添加一个带有图标的树控件,类似于您在文件管理器上看到的那样。我决定使用struts2-dojo-plugin中提供的树控件。树显示得很好,但我找不到向节点添加图标装饰的方法。有人知道该怎么做吗?
到目前为止,我已经搜索了来源和互联网,但没有运气。我得到的最接近的是来自插件发行版中名为 TreeDocIconExtention 的微弱气味。这是我需要的吗?
这是到目前为止的代码:
<sx:tree id="theTree" label="The Tree">
<sx:treenode id="node1" label="Node 1" nodeType='' />
<sx:treenode id="node2" label="Node 2">
<sx:treenode id="node3" label="Node 3" />
<sx:treenode id="node4" label="Node 4" />
</sx:treenode>
<sx:treenode id="node5" label="Node 5" />
</sx:tree>
So, I've got a Struts2.1.8 application and I want to add a tree control with icons, similar to what you see on a file manager. I decided to use the tree control provided in the struts2-dojo-plugin. The tree displays just fine, but I can't find a way to add icon decorations to the nodes. Anyone know how to do this?
I've searched the source and the interwebs with no luck so far. The closest I got was a faint whiff from something in the plugin distribution called TreeDocIconExtention. Is this what I need?
Here's the code so far:
<sx:tree id="theTree" label="The Tree">
<sx:treenode id="node1" label="Node 1" nodeType='' />
<sx:treenode id="node2" label="Node 2">
<sx:treenode id="node3" label="Node 3" />
<sx:treenode id="node4" label="Node 4" />
</sx:treenode>
<sx:treenode id="node5" label="Node 5" />
</sx:tree>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有点脏 - 但它有效:您可以在属性标签内放置一个 img 标签 - 您只需在属性标签内使用 ' (apos) 而不是 " (quot),例如:
little bit dirty - but it works: you can put a img-tag within the attribute label - you just have to use ' (apos) instead of " (quot) within the attribute label, e.g.: