最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

ExtJs動(dòng)態(tài)生成treepanel的Json格式

 更新時(shí)間:2015年07月19日 11:47:17   投稿:hebedich  
這篇文章主要介紹了ExtJs動(dòng)態(tài)生成treepanel的Json格式的相關(guān)資料,需要的朋友可以參考下

在節(jié)點(diǎn)中加上"checked"屬性,會(huì)自動(dòng)生成checkbox。

獲取選中節(jié)點(diǎn)

var nodeArray = "";
var nodesObj = mytree.getChecked();

var i;var length=nodesObj .length;
for (i = 0; i < length; i++) {
nodeArray += nodesObj[i].id + ',';   //允許多選的情況。如果不允許多選,就直接nodesObj[i].id 
}

nodeArray = nodeArray.substring(0, nodeArray.length - 1); 

Json格式如下:

[{
"text": "To Do", 
"cls": "folder",
"expanded": true,
"children": [{
"text": "Go jogging",
"leaf": true,
"checked": true
},{
"text": "Take a nap",
"leaf": true,
"checked": false
},{
"text": "Climb Everest",
"leaf": true,
"checked": false
}]
},{
"text": "Grocery List",
"cls": "folder",
"children": [{
"text": "Bananas",
"leaf": true,
"checked": false
},{
"text": "Milk",
"leaf": true,
"checked": false
},{
"text": "Cereal",
"leaf": true,
"checked": false
},{
"text": "Energy foods",
"cls": "folder",
"children": [{
"text": "Coffee",
"leaf": true,
"checked": false
},{
"text": "Red Bull",
"leaf": true,
"checked": false
}]
}]
},{
"text": "Remodel Project", 
"cls": "folder",
"children": [{
"text": "Finish the budget",
"leaf": true,
"checked": false
},{
"text": "Call contractors",
"leaf": true,
"checked": false
},{
"text": "Choose design",
"leaf": true,
"checked": false
}]
}]

以上所述就是本文的全部?jī)?nèi)容了,希望大家能夠喜歡。

相關(guān)文章

最新評(píng)論

新闻| 宁武县| 莱芜市| 望谟县| 郸城县| 禹州市| 江永县| 荔浦县| 怀化市| 婺源县| 通河县| 黄山市| 南靖县| 灵寿县| 泾川县| 万宁市| 景洪市| 缙云县| 苏州市| 太白县| 江津市| 沁水县| 文昌市| 抚宁县| 布拖县| 阿拉善右旗| 陵水| 海南省| 大名县| 新丰县| 高碑店市| 大竹县| 寻甸| 德庆县| 绥芬河市| 广昌县| 类乌齐县| 翁牛特旗| 新安县| 台湾省| 历史|