leftztree : function(){ $.ajax({ url : commonFunction.config.leftztreeUrl, dataType : "json", type : "POST", async : false, success : function(data) { zNodes = data; $.fn.zTree.init($("#treeCity"), setting, zNodes); }, error : function(data)// 服务器响应失败处理函数 { console.log("服务器异常"); } }); },
var setting = { view: { selectedMulti: false, showIcon: false , addHoverDom: addHoverDom, removeHoverDom: removeHoverDom }, check: { enable: true, chkStyle: "checkbox" }, data: { simpleData: { enable: true } }, /*点击事件*/ callback: { beforeClick: zTreeBeforeClick, onclick:zTreeBeforeClick } };
var zTree = $.fn.zTree.getZTreeObj("treeCity"); var node = zTree.getNodeByParam("id",fileSucessdData[0].rid); zTree.selectNode(node); $("#"+node.tId+"_span").click();