New to Kendo UI for jQuery? Start a free 30-day trial

DataIconField

configuration

Sets the field of the data item that provides the icon name of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

The field can also hold an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

dataIconField

String|Array

Default: null

<div id="treeview"></div>
<script>
var items = [
  { text: "Documents", iconName: "folder" },
  { text: "Report.pdf", iconName: "file-pdf" }
];
$("#treeview").kendoTreeView({
  dataIconField: "iconName",
  dataSource: items
});
</script>
<div id="treeview"></div>
<script>
var items = [
  { text: "Root", rootIcon: "folder", items: [
    { text: "Child", childIcon: "file" }
  ] }
];
$("#treeview").kendoTreeView({
  dataIconField: ["rootIcon", "childIcon"],
  dataSource: items
});
</script>
Not finding the help you need?
Contact Support