0

我想从 json 生成树视图,但我需要填写。treeview的节点中的“attr or .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>
4

1 回答 1

0

请看这篇博客文章,它解释了将 wijtree 作为 json 对象绑定到外部数据源: http ://wijmo.com/populate-wijtree-from-external-data-source-using-knockout/

于 2013-07-22T08:14:36.020 回答