Kendo Treelist imageClass not supported anymore

140 Views Asked by At

I need the new equivalent for imageClass for TreeLIST or any other possibility to add an icon to an treelist TOOLBAR button

1

There are 1 best solutions below

1
On

The toolbar accepts a template so you can customize your whole toolbar. The negative part is that you need to write the whole HTML for each button and handle all its events as well. Still, it is an alternative. Example:

  $("#treeList").kendoTreeList({
    toolbar: '<button type="button" data-command="custom" class="k-button k-button-icontext about-button"><span class="k-icon k-i-info"></span>About</button>',
    columns: [
      "lastName",
      "position"
    ],
    dataSource: [
      { id: 1, parentId: null, lastName: "Jackson", position: "CEO" },
      { id: 2, parentId: 1, lastName: "Weber", position: "  VP, Engineering" }
    ]
  });
  
  $("#treeList").on("click", "button.about-button", function() {
    console.log("About button clicked");
  });
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script><script src="https://kendo.cdn.telerik.com/2018.3.911/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.911/styles/kendo.common.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.911/styles/kendo.rtl.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.911/styles/kendo.silver.min.css"/>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.3.911/styles/kendo.mobile.all.min.css"/>
    
<div id="treeList"></div>