GoS*_*ash 13 javascript kendo-ui angularjs kendo-treeview
我正在尝试在Kendo树视图节点中添加多个按钮.我使用模板添加多个按钮,但由于整个节点正在处理链接,因此无法实现其功能.请在下面找到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>
Run Code Online (Sandbox Code Playgroud)
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" }
]
});
Run Code Online (Sandbox Code Playgroud)
屏幕截图供参考:
| 归档时间: |
|
| 查看次数: |
644 次 |
| 最近记录: |