function onCheck(e, treeId, treeNode) {
???var zTree = $.fn.zTree.getZTreeObj("testtree"),
???nodes = zTree.getCheckedNodes(true),
???v = "";
???for (var i=0, l=nodes.length; i<l; i++) {
????v += nodes[i].name + ",";
????alert(nodes[i].id);?? //获取选中节点的id值
????document.getElementById('test').value=nodes[i].id;
???}
???if (v.length > 0 ) v = v.substring(0, v.length-1);
???var cityObj = $("#citySel");
???cityObj.attr("value", v);
??}
?
?
<input type="hidden" name="test" id="test">
?
....
<div id="menuContent" class="menuContent" style="display:none; position: absolute;">
?<ul id="testtree" class="ztree" style="margin-top:0; width:280px; height: 300px;"></ul>
</div>