【问题标题】:Angularjs kendo treeview not showing checboxes in Kendo popupAngularjs剑道树视图未在剑道弹出窗口中显示复选框
【发布时间】:2015-09-02 09:53:23
【问题描述】:

我正在使用 Kendo Window,其中显示带有复选框的 Kendo TreeView。问题是树视图正确呈现但未显示复选框。如果我在 Kendo Window 之外渲染树视图(即直接在我的页面中),那么它会正确显示复选框。

请帮忙,因为我被困住了。以下是我使用的代码:

<div kendo-tree-view k-options="treeOptions" k-data-source="treeDataSource"></div>


$scope.treeOptions = {
   checkboxes: {
      checkChildren: true
   }
};

【问题讨论】:

    标签: angularjs kendo-ui treeview kendo-treeview


    【解决方案1】:

    这段代码似乎运行良好:

    <div kendo-window>
      <div kendo-tree-view k-options="treeOptions" k-data-source="treeDataSource"></div>
    </div>
    <script>
      angular.module("app", ["kendo.directives"]).controller("controller", function($scope) {
        $scope.treeOptions = {
          checkboxes: {
            checkChildren: true
          }
        };
        $scope.treeDataSource =  [
            { text: "Furniture", expanded: true, items: [
                { text: "Tables & Chairs" },
                { text: "Sofas" },
                { text: "Occasional Furniture" }
            ] },
            { text: "Decor", items: [
                { text: "Bed Linen" },
                { text: "Curtains & Blinds" },
                { text: "Carpets" }
            ] }
        ];
      });
    </script>
    

    现场演示:http://dojo.telerik.com/@korchev/INezO/2

    【讨论】:

    • 感谢阿塔纳斯的回复。实际上,我将 treeOptions 编码到按钮的单击事件中,这就是它不起作用的原因。根据您的说法,我们应该直接在控制器中指定 treeOptions。
    猜你喜欢
    • 2017-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 2020-11-30
    • 1970-01-01
    相关资源
    最近更新 更多