Javascript jQuery Wijmo,带有json属性的treeview

Javascript jQuery Wijmo,带有json属性的treeview,javascript,jquery,json,jquery-ui,wijmo,Javascript,Jquery,Json,Jquery Ui,Wijmo,我想从json生成一个树视图,但我需要填充。treeview节点中的“attr或.date” 怎么办 data = [{ "text": "Item 1", "attr": { "id": 12145646541 "class": "folder" } }, { "text": "Item 2", "nodes": [{ "text": "Item 2.1" }, { "text": "Item 2.2" }, { "text": "I

我想从json生成一个树视图,但我需要填充。treeview节点中的“attr或.date” 怎么办

data = [{
  "text": "Item 1",
  "attr": {
    "id": 12145646541 "class": "folder"
  }
}, {
  "text": "Item 2",
  "nodes": [{
    "text": "Item 2.1"
  }, {
    "text": "Item 2.2"
  }, {
    "text": "Item 2.3"
  }]
}, {
  "text": "Item 3"
}, {
  "text": "Item 4"
}]

$("#ul_menu").wijtree({
  nodes: data
});

<ul id="ul_menu"></ul>
数据=[{
“文本”:“第1项”,
“属性”:{
“id”:121456441“类”:“文件夹”
}
}, {
“案文”:“第2项”,
“节点”:[{
“正文”:“第2.1项”
}, {
“正文”:“第2.2项”
}, {
“正文”:“第2.3项”
}]
}, {
“案文”:“项目3”
}, {
“案文”:“项目4”
}]
$(“#ul#u菜单”).wijtree({
节点:数据
});

    请看这篇博客文章,它解释了如何将wijtree作为json对象绑定到外部数据源: