求助,ztree得到json数据却显示
1个回答
展开全部
var zTreeObj,
setting = {
view: {
selectedMulti: false
}
},
//json数据
var zNodes =[
{id:4, pId:0, name:"河北省", open:false, nocheck:true},
{id:41, pId:4, name:"石家庄", open:false, nocheck:true},
{id:42, pId:4, name:"保定", open:false, nocheck:true},
{id:43, pId:4, name:"邯郸", open:false, nocheck:true},
{id:44, pId:41, name:"承德"},
{id:45, pId:42, name:"承德"},
{id:46, pId:43, name:"承德"},
{id:47, pId:43, name:"承德"},
];
//将json数据显示成ztree树
$(document).ready(function(){
zTreeObj = $.fn.zTree.init($("#tree"), setting, zNodes);
});
setting = {
view: {
selectedMulti: false
}
},
//json数据
var zNodes =[
{id:4, pId:0, name:"河北省", open:false, nocheck:true},
{id:41, pId:4, name:"石家庄", open:false, nocheck:true},
{id:42, pId:4, name:"保定", open:false, nocheck:true},
{id:43, pId:4, name:"邯郸", open:false, nocheck:true},
{id:44, pId:41, name:"承德"},
{id:45, pId:42, name:"承德"},
{id:46, pId:43, name:"承德"},
{id:47, pId:43, name:"承德"},
];
//将json数据显示成ztree树
$(document).ready(function(){
zTreeObj = $.fn.zTree.init($("#tree"), setting, zNodes);
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询