KendoTreeView和AngularJS:不显示图标

时间:2014-11-14 21:34:37

标签: css angularjs kendo-ui kendo-treeview

知道为什么图标没有显示in this tree

这是HTML:

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

这是CSS:

  #tree .k-sprite {
        background-image: url("http://demos.telerik.com/kendo-ui/content/web/treeview/coloricons-sprite.png");
      }

   .rootfolder { background-position: 0 0; }
   .folder { background-position: 0 -16px; }

这是javascript;

  $scope.treeData = new kendo.data.HierarchicalDataSource({
            data: [
                { text: "Furniture", icon: "folder", items: [
                    { text: "Tables & Chairs", icon: "folder" },
                    { text: "Occasional Furniture", icon: "folder" }
                ] },
                { text: "Decor", icon: "folder", items: [
                    { text: "Bed Linen", icon: "folder" },
                    { text: "Carpets", icon: "folder" }
                ] }
            ]
        });


  $scope.treeOptions = {
        dataSpriteCssClassField: "icon"
  };

1 个答案:

答案 0 :(得分:0)

您的DOM中的tree ID没有任何内容。

尝试将#tree切换为.k-treeview,图标将显示:

Plunker illustrating this here