javascript - Kendo Treeview Angularjs 上的自定义按钮

标签 javascript angularjs kendo-ui kendo-treeview

我正在尝试在 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" }
            ]
        }); 

引用截图:

enter image description here

最佳答案

我已经在我身边测试了一个类似的场景,它在我的案例中工作正常。这是我的测试 dojo .请您检查一下,如果您的情况有所不同或者仍然无法正常工作,请告诉我。

关于javascript - Kendo Treeview Angularjs 上的自定义按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50646874/

相关文章:

angularjs - 评估 ngrepeat 的表达式

javascript - Kendo UI 自动完成 全选

mvvm - 如何进一步 MVVM Kendo UI 小部件?

javascript - 在 1.10.2 Jquery 版本中替换 $.uaMatch

javascript - 网格显示没有数据,但有请求直接为什么

javascript - 从其他 HTML 文件加载 HTML 文件中的特定 div

javascript - AngularJS Typeahead 回调函数

javascript - Angular JS ng-click 不适用于 ng-repeat 之类的过滤器

javascript - Kendo UI,如何在 kendo 网格单元格上手动调用 validate()

javascript - jQuery 在页面上显示输入的文本