码迷,mamicode.com
首页 > Windows程序 > 详细

MVC部门树的实现 http://www.ztree.me/v3/api.php

时间:2015-04-28 20:20:54      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

<ul id="treeDemo" class="ztree">
</ul>

$(function () {
$.fn.zTree.init($("#treeDemo"), setting);

})

//#region 树
var setting = {
async: {
enable: true,
url: GetUrl(‘/Dept/GetDeptTree‘),
dataFilter: filter
},
data: {
simpleData:
{
enable: true
}
},
callback: {
onClick: onClick
}
};
function filter(treeId, parentNode, childNodes) {
if (!childNodes) return null;
for (var i = 0, l = childNodes.length; i < l; i++) {
childNodes[i].name = childNodes[i].name.replace(/\.n/g, ‘.‘);
}
return childNodes;
}

//树点击事件
function onClick(event, treeId, treeNode, clickFlag) {
import_Name = treeNode.name;
import_id = treeNode.id;
$("#hidTreeDept").val(treeNode.id);
$("#hidTreeDeptName").val(treeNode.name);
searchItem = { DeptID: $("#hidTreeDept").val() };
DataBind();
}
//#endregion

MVC部门树的实现 http://www.ztree.me/v3/api.php

标签:

原文地址:http://www.cnblogs.com/treeleaf/p/4463633.html

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