码迷,mamicode.com
首页 > 其他好文 > 详细

ztree 展示

时间:2015-12-17 12:46:43      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

1. controller
@RequestMapping("/function.htm")
public String function(HttpSession session, Model model, RequestParameter param) {

pmap.clear();
List<FunctionSimple> listFunSimp = functionService.getFunctionSimpleList(pmap);
if (listFunSimp != null && listFunSimp.size() > 0) {
System.out.println(JSON.toJSON(listFunSimp).toString().replace("\"", "\‘"));
model.addAttribute("initnodes", JSON.toJSON(listFunSimp).toString().replace("\"", "\‘"));
}
return "auth/function";
}

 

2.jsp:

$(document).ready(function() {

var s = $(‘#hinitnodes‘).val();
if (s != "") {
s = s.replace(/\‘/g, "\"");
zNodes = JSON.parse(s);
}
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
$("#selectAll").bind("click", selectAll);
});


<body>
<div class="content_wrap">
<input type="hidden" id="hinitnodes" name="hinitnodes" value="${initnodes}" />
<div class="zTreeDemoBackground left">
<ul id="treeDemo" class="ztree"></ul>
</div>
</div>
</body>

ztree 展示

标签:

原文地址:http://www.cnblogs.com/wzz1020/p/5053283.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!