我正在尝试在 Kendo Treeview 节点中添加多个按钮。我使用模板添加了多个按钮,但未能实现它们的功能,因为整个节点都在链接。请在下面找到 HTML 和 JS
HTML
<div kendo-tree-view="tree" k-data-source="treeData" class="hasMenu" k-on-change="selectedItem = dataItem">
<span k-template>
{{dataItem.text}}
<i class="fa fa-plus" aria-hidden="true"></i>
<i class="fa fa-trash" aria-hidden="true"></i>
</span>
</div>
JS
$scope.treeData = new kendo.data.HierarchicalDataSource(
{
data: [
{
text: "My Product",
items: [
{
text: "Building Materials",
items: [
{ text: "Lumber & Composites" },
{ text: "Molding" },
{ text: "Drywall" },
{ text: "Doors" }
]
},
{ text: "Decor" },
{ text: "Chemicals" },
{ text: "Hardware" },
{ text: "Lighting & Fixtures" },
{ text: "Paint" },
{ text: "Storage & Organization" },
{ text: "Window Coverings" },
]
},
{
text: "Service",
items: [
{ text: "Labor" },
{ text: "Installation" },
{ text: "Removal Service" },
{ text: "Travel" },
{ text: "Ladder" },
{ text: "Service Call" },
]
},
{ text: "Discount" }
]
});
引用截图:
最佳答案
我已经在我身边测试了一个类似的场景,它在我的案例中工作正常。这是我的测试 dojo .请您检查一下,如果您的情况有所不同或者仍然无法正常工作,请告诉我。
关于javascript - Kendo Treeview Angularjs 上的自定义按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50646874/