0

我需要imageClass用于 TreeLIST 的新等价物或任何其他将图标添加到树形列表工具栏按钮的可能性

4

1 回答 1

0

接受模板,toolbar因此您可以自定义整个工具栏。不利的部分是您需要为每个按钮编写整个 HTML 并处理其所有事件。尽管如此,它仍然是一个替代方案。例子:

  $("#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>

于 2018-10-02T14:06:03.957 回答