- 注册时间
- 2013-5-22
- 最后登录
- 2014-5-22
- 阅读权限
- 10
- 积分
- 131
- 精华
- 0
- 帖子
- 50
|
felt 发表于 2014-5-19 14:12
请参考我们的demo
MiniUI事件绑定一种是直接写在标签上 onclick="function"
另一种是js绑定 control.o ...
<ul id="tree2" class="mini-tree" url="data/privilegetree.ashx" style="width: 100%;
padding: 5px;" showtreeicon="true" textfield="Privilegename" idfield="Privilegeid"
parentfield="Privilegeparentid" resultastree="false" showcheckbox="true" checkrecursive="false"
onbeforenodecheck="onBeforeNodeCheck" allowselect="false" enablehottrack="false" onbeforeexpand="onBeforeExpand" onnodeselect="onNodeSelect" >
</ul>
//监听点击事件
function onNodeSelect(e) {
var tree = e.sender;
var nowNode = e.node;
var node = tree.getValue(true);
var nodes = tree.getCheckedNodes();
var pid = "";
var pname = "";
for (var i = 0; i < nodes.length; i++) {
pid += nodes.Privilegeid + ",";
pname += nodes.Privilegename + ",";
}
pid = pid.substr(0, pid.length - 1);
pname = pname.substr(0, pname.length - 1);
document.getElementById("txtPrivilegeName").value = pname;
$("#txtPrivilegeID").val(pid);
$("#temp").val(pname);
var old = document.getElementById("old").value;
var temp = document.getElementById("temp").value;
$("#txtPriviName").val(old +temp);
}
是这样写吗? |
|