首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

jquert easyUI combotree解决思路

2012-08-11 
jquert easyUI combotree怎么将后台传过来的json中的 name 字段里的值加载到combotree的 text 里?[解决办

jquert easyUI combotree
怎么将后台传过来的json中的 name 字段里的值加载到combotree的 text 里?

[解决办法]
jquery easyui的combotree的数据源要求指定格式属性的,你可以在后台将json转化成它需要的格式,或者到前台页面上用js重新组装成它需要的格式即可。

下面是它要求的格式,json数组,text就是显示值,children字节点

JScript code
[{    "id":1,    "text":"Folder1",    "iconCls":"icon-ok",    "children":[{        "id":2,        "text":"File1",        "checked":true    },{        "id":3,        "text":"Folder2",        "state":"open",        "children":[{            "id":4,            "text":"File3",            "attributes":{                "p1":"value1",                "p2":"value2"            },            "checked":true,            "iconCls":"icon-reload"        },{            "id": 8,            "text":"Async Folder",            "state":"closed"        }]    }]}] 

热点排行