Commit a5127fc5 by 扎西多顿 Committed by stylefeng

Merge pull request !15 from 扎西多顿/master

parents d44f0999 fc72457a
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
this.url = url; this.url = url;
this.onClick = null; this.onClick = null;
this.settings = null; this.settings = null;
this.ondblclick=null;
}; };
$ZTree.prototype = { $ZTree.prototype = {
...@@ -22,7 +23,8 @@ ...@@ -22,7 +23,8 @@
}, },
data : {simpleData : {enable : true}}, data : {simpleData : {enable : true}},
callback : { callback : {
onClick : this.onClick onClick : this.onClick,
onDblClick:this.ondblclick
} }
}; };
return settings; return settings;
...@@ -55,6 +57,13 @@ ...@@ -55,6 +57,13 @@
bindOnClick : function(func) { bindOnClick : function(func) {
this.onClick = func; this.onClick = func;
}, },
/**
* 绑定双击事件
*/
bindOnDblClick : function(func) {
this.ondblclick=func;
},
/** /**
* 加载节点 * 加载节点
......
...@@ -77,6 +77,11 @@ RolInfoDlg.onClickDept = function (e, treeId, treeNode) { ...@@ -77,6 +77,11 @@ RolInfoDlg.onClickDept = function (e, treeId, treeNode) {
$("#deptName").attr("value", RolInfoDlg.deptZtree.getSelectedVal()); $("#deptName").attr("value", RolInfoDlg.deptZtree.getSelectedVal());
$("#deptid").attr("value", treeNode.id); $("#deptid").attr("value", treeNode.id);
}; };
RolInfoDlg.onDblClickDept = function (e, treeId, treeNode) {
$("#deptName").attr("value", RolInfoDlg.deptZtree.getSelectedVal());
$("#deptid").attr("value", treeNode.id);
$("#deptContent").fadeOut("fast");
};
/** /**
* 点击父级菜单input框时 * 点击父级菜单input框时
...@@ -178,6 +183,7 @@ $(function () { ...@@ -178,6 +183,7 @@ $(function () {
var deptTree = new $ZTree("deptTree", "/dept/tree"); var deptTree = new $ZTree("deptTree", "/dept/tree");
deptTree.bindOnClick(RolInfoDlg.onClickDept); deptTree.bindOnClick(RolInfoDlg.onClickDept);
deptTree.bindOnDblClick(RolInfoDlg.onDblClickDept)
deptTree.init(); deptTree.init();
RolInfoDlg.deptZtree = deptTree; RolInfoDlg.deptZtree = deptTree;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment