知道为什么图标没有显示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"
};
答案 0 :(得分:0)