剑道树上的自定义按钮查看Angularjs

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)

屏幕截图供参考:

在此输入图像描述

小智 7

我已经在我身边测试了类似的场景,并且在我的情况下它正常工作.这是我的测试道场.如果您的方案不同或者它仍然无法正常工作,请您查看它并告诉我.