ITeye博客

Struts2使用<s:tree>标签显示无限树形菜单

minfirefox · 2008-11-19 14:20 · Struts2 · 企业架构 · Markdown

级联显示无限树形菜单 效果图:

实体类Node:


public class Node implements java.io.Serializable {
	
	private Integer id;
	//父节点
	private Node parentNode = null;
	//所有子节点
	private Set<Node> childrenSet = new TreeSet<Node>();

	private String name = "";

	//其它属性
	//getXxx()、setXxx()
}

JSP页面中使用<s:tree>标签显示,其中: rootNode表示Action中的传递的根节点, childCollectionProperty表示node下所有子节点, nodeIdProperty表示根节点的id。


<s:tree id="treeTestId" theme="ajax" rootNode="node" 
	templateCssPath="treenode.css"
	childCollectionProperty="childrenSet" nodeIdProperty="id"
	nodeTitleProperty="'<a href=manage.action?id='+id+' target=main>'+name +'</a>'"
	treeSelectedTopic="treeSelected"
	showRootGrid="false" showGrid="true">
</s:tree>

数据库中:

评论(14)

  1. #14 楼 · chenxiang_chenxiang · 2012-09-06 09:24

    能不能把源代码发出来,一起分享

  2. #13 楼 · jiwenfengtiger · 2012-06-15 14:25

    可以提供一个这个的示列给我么? 我的邮箱是:261659124@qq.com 在这先谢谢了

  3. #12 楼 · minfirefox · 2009-09-17 18:12

    源码已遗失

  4. #11 楼 · minfirefox · 2009-09-17 18:11

    ycdxg writes:

    能把css文件提供一下吧,楼主,谢谢了

    CSS文件在struts2的JAR包里边,具体位置不记得了。

  5. #10 楼 · ycdxg · 2009-08-20 09:59

    能把css文件提供一下吧,楼主,谢谢了

  6. #9 楼 · lhp3000 · 2009-03-01 11:18

    大虾,把源码给我发一个。250601947@qq.com

  7. #8 楼 · glagra · 2009-02-27 18:01

    哥们,能不能把这标签里所有的属性意义给标出来啊。。或者发我邮箱:j2ee_.net@163.com。。小弟谢过了!

  8. #7 楼 · mj4678 · 2008-11-26 15:25

    有源代码么。给发个学习下。谢谢了..547183495@qq.com

  9. #6 楼 · Satan · 2008-11-24 12:01

    干脆把源码发出来吧,否则单纯的介绍毫无意义。

  10. #5 楼 · mosheo · 2008-11-24 09:49

    我也要一份,谢谢 mosheo_deng@126.com

  11. #4 楼 · wuyingsong · 2008-11-24 09:39

    也发一份给我吧。谢谢! wuyingsonghappy@163.com

  12. #3 楼 · tcrct · 2008-11-24 00:20

    也发一份给我吧。谢谢! tcrct@126.com

  13. #2 楼 · slc123 · 2008-11-23 21:13

    能不能把源码分享给我那,非常感谢。 我的邮箱:slchao123@163.com

  14. #1 楼 · hehe389 · 2008-11-21 10:35

    能不能吧代码吧原代码发出来啊 谢谢

评论功能维护中,当前仅展示历史评论。