请问下 我想用ajax动态的从后台获取地区的数据 怎么获取 下面这是一个静态的 !
<SCRIPT type="text/javascript">
<!--
var setting = {
view: {
showIcon: showIconForTree
},
data: {
simpleData: {
enable: true
}
}
};
var zNodes =[
{ id:1, pId:0, name:"父节点1 - 展开", open:true},
{ id:11, pId:1, name:"父节点11 - 折叠"},
{ id:111, pId:11, name:"叶子节点111"},
{ id:112, pId:11, name:"叶子节点112"},
{ id:113, pId:11, name:"叶子节点113"},
{ id:114, pId:11, name:"叶子节点114"},
{ id:12, pId:1, name:"父节点12 - 折叠"},
{ id:121, pId:12, name:"叶子节点121"},
{ id:122, pId:12, name:"叶子节点122"},
{ id:123, pId:12, name:"叶子节点123"},
{ id:124, pId:12, name:"叶子节点124"},
{ id:13, pId:1, name:"父节点13 - 没有子节点", isParent:true}
];
function showIconForTree(treeId, treeNode) {
return !treeNode.isParent;
};
$(document).ready(function(){
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
});
//-->
</SCRIPT>
</HEAD>
<BODY>
<h1>不显示节点图标的树</h1>
<div class="content_wrap">
<div class="zTreeDemoBackground left">
<ul id="treeDemo" class="ztree"></ul>
</div>
</BODY>
</HTML>
3.X的是这样写的
var setting = {
checkable : true,
callback : {
onClick: zTreeOnClick
},
expandSpeed :"fast",
async: {
enable: true,
url:"getTreeNode.jsp",
autoParam:["id","name"],
dataFilter: null
},
view: {
showLine: false,
dblClickExpand :false
}};
$.fn.zTree.init($("#sidebar"), setting);
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。