我已经实现了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: '',
});
}
]);