EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: mars610 on July 19, 2011, 07:26:47 PM



Title: User combotree return json string problem
Post by: mars610 on July 19, 2011, 07:26:47 PM
Hi, I use combotree to show tree data, I found combotree receive json string like this:
[{
   "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"
      }]
   }]
},{
   "text":"Languages",
   "state":"closed",
   "children":[{
      "id":"j1",
      "text":"Java"
   },{
      "id":"j2",
      "text":"C#"
   }]
}]


but our project framework used 'Struts2' and struts2-json-plugin return json string , and data like this:
{"data":[{"children":[],"id":6,"text":"org6"}]}

the return json string add 'data' key, How should I let it parse the data, or return to the format defined