首页 > 解决方案 > IVH TreeView Twistie 没有触发与其绑定的功能

问题描述

我已经实现了 IVH 树视图并且运行良好。

但是在运行时,我需要为我的 JSON 获取“儿童”数据,因此尝试将我的 API 调用绑定到 IVH TreeView 的 Collapsed Twistie,如下所示,但它不会触发该函数getChildrenNodes(node.Code)。有人可以帮我吗?

    app.config(['ivhTreeviewOptionsProvider',
    function (ivhTreeviewOptionsProvider) {
        ivhTreeviewOptionsProvider.set({
            idAttribute: 'Code',
            labelAttribute: 'Name',
            childrenAttribute: 'children',
            selectedAttribute: 'selected',
            useCheckboxes: true,
            expandToDepth: 0,
            defaultSelectedState: true,
            validate: true,
            twistieExpandedTpl: '<span class="show-hide"><i class="fa fa-minus"></i></span>',
            twistieCollapsedTpl: '<span ng-show="node.HasChildren" ng-click="getChildrenNodes(node.Code)" class="show-hide"><i class="fa fa-plus"></i></span>',
            twistieLeafTpl: '',
        });
    }
]);

标签: javascriptangulartreeview

解决方案


推荐阅读