首页 新闻 会员 周边

jstree绑定子节点的问题

0
悬赏园豆:5 [已解决问题] 解决于 2013-05-30 09:59

<script type="text/javascript">
$(function(){

$('div.middle-center').layout({
  center__paneSelector:".inner-center",west__paneSelector:".inner-west",east__paneSelector:"false",north__paneSelector:"false",south__paneSelector:"false",west__size:194,spacing_open:5,spacing_closed:5,west__spacing_closed:5
  });
$("#weastCotent").height($('div.middle-center').height()-35);

//Tree
var o = { showcheck: true };
o.data = typedata;
$("#tree").treeview(o);
})
</script>

 <div id='weastCotent'><div id='tree'></div></div>

其中  o.data = typedata;
typedata的结果是
treedata = [
{ "id": "0", "text": "身份类别", "value": "80", "showcheck": false, complete: true, "isexpand": true, "checkstate": 0},
{ "id": "1", "text": "新闻类别", "value": "81", "showcheck": false, complete: true, "isexpand": true, "checkstate": 0},
{ "id": "2", "text": "通知类别", "value": "82", "showcheck": false, complete: true, "isexpand": true, "checkstate": 1}]
求子节点的数据类型

现在父节点我已经显示数来了  我想知道子节点的数据类型应该是怎么样的

飞翔的鱼的主页 飞翔的鱼 | 初学一级 | 园豆:3
提问于:2013-05-21 15:56
< >
分享
最佳答案
1
ChildNodes: [{ id: "3", text: "身份类别1", value: "81", hasChildren: false, isexpand: false, 
complete: true, ChildNodes: null},{ id: "3", text: "身份类别4", value: "81", hasChildren: false,
isexpand: false, complete: true, ChildNodes: null}]

收获园豆:5
yyutudou | 小虾三级 |园豆:997 | 2013-05-21 20:03

继续求帮助啊 这段代码应该是放在 checkstate的后面吗

{ "id": "0", "text": "身份类别", "value": "80", "showcheck": false, complete: true, "isexpand": true, "checkstate": 0,ChildNodes: [{ id: "3", text: "身份类别1", value: "81", hasChildren: false, isexpand: false,
complete: true, ChildNodes: null},{ id: "3", text: "身份类别4", value: "81", hasChildren: false,
isexpand: false, complete: true, ChildNodes: null}]},

这么放格式对吗 ?可是结果还是不显示 啊

飞翔的鱼 | 园豆:3 (初学一级) | 2013-05-22 09:02

@飞翔的鱼: hasChildren: true

yyutudou | 园豆:997 (小虾三级) | 2013-05-22 09:12

高手 求QQ啊

飞翔的鱼 | 园豆:3 (初学一级) | 2013-05-22 09:13

@yuyangtudou: 

{ "id": "0", "text": "教工3菜单", "value": "80", "showcheck": false, complete: false, "isexpand": true, "checkstate": 1, "ChildNodes": [{ "id": "3", "text": "身份类别1", "value": "81", "hasChildren": true, "isexpand": false, "complete": true, "ChildNodes": null }, { "id": "3", "text": "身份类别4", "value": "81", "hasChildren": true, "isexpand": false, "complete": true, "ChildNodes": null}] }

改了 还是没反应啊 真心 求帮忙

飞翔的鱼 | 园豆:3 (初学一级) | 2013-05-22 09:38

@飞翔的鱼: 

{ "id": "0", "text": "教工3菜单", "value": "80",hasChildren:true, "showcheck": false, 
complete: false, "isexpand": true, "checkstate": 1,
"ChildNodes": [{ "id": "3", "text": "身份类别1", "value": "81", "hasChildren": true,
"isexpand": false, "complete": true, "ChildNodes": null },
{ "id": "3", "text": "身份类别4", "value": "81", "hasChildren": true, "isexpand": false,
"complete": true, "ChildNodes": null}] }
yyutudou | 园豆:997 (小虾三级) | 2013-05-22 09:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册