Kendo Treelist imageClass больше не поддерживается
Мне нужен новый эквивалент для imageClass
для TreeLIST или любой другой возможности добавить иконку в трелистлист кнопку TOOLBAR
1 ответ
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>