【问题标题】:How to render a treeview using Angular and Kendo UI如何使用 Angular 和 Kendo UI 渲染树视图
【发布时间】:2013-08-25 04:51:11
【问题描述】:

我在尝试使用 angular 和 kendo 渲染树视图时遇到了很大的困难。这是我到目前为止的代码:

Website1.controller("FieldsController1", function ($scope) {
     $scope.things = {
                data: [
                    {
                        text: "Furniture", items: [
                          { text: "Tables & Chairs" },
                          { text: "Sofas" },
                          { text: "Occasional Furniture" }
                        ]
                    },
                    {
                        text: "Decor", items: [
                          { text: "Bed Linen" },
                          { text: "Curtains & Blinds" },
                          { text: "Carpets" }
                        ]
                    }
                ]
            };

上面是控制器。这是标记。

<ul kendo-tree-view k-hierarchical-data-source="things">
</ul>

另外,是否有任何文档说明如何执行此操作?

【问题讨论】:

标签: angularjs kendo-ui kendo-treeview


【解决方案1】:

我通过 k-options 得到了它。

http://jsfiddle.net/M84qj/1/

我能找到的唯一文档是这个页面,从你对“事物”的使用来看,你也找到了这个页面:p

http://kendo-labs.github.io/angular-kendo/#/

Kendo + Angular 祝你好运:)

【讨论】:

    【解决方案2】:

    虽然这篇文章有点陈旧,但它是最早出现在 Google 搜索中的文章之一。创建树视图时,请确保创建 HierarchicalDataSource。这允许您定义子节点和其他属性,例如项目是否应具有子节点。这对使用远程数据源有很大帮助。

    【讨论】:

      猜你喜欢
      • 2015-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-17
      • 2015-11-15
      • 1970-01-01
      • 1970-01-01
      • 2019-05-17
      相关资源
      最近更新 更多