【问题标题】:jQuery Wijmo, treeview with attributes from jsonjQuery Wijmo,带有来自 json 属性的树视图
【发布时间】:2013-07-18 19:08:59
【问题描述】:

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

【问题讨论】:

    标签: javascript jquery json jquery-ui wijmo


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2015-05-11
      • 2018-08-18
      • 2016-11-11
      • 1970-01-01
      • 1970-01-01
      • 2020-05-07
      • 1970-01-01
      • 2021-09-09
      • 1970-01-01
      相关资源
      最近更新 更多