Home > Web Front-end > JS Tutorial > Detailed explanation of angular ztree ladder structure

Detailed explanation of angular ztree ladder structure

零下一度
Release: 2017-06-26 10:41:44
Original
2454 people have browsed it
$scope.initZtreeData = url = = res.respData; setting = zTree = $.fn.zTree.init($( functionLimitList = $.fn.zTree.getZTreeObj(
Copy after login
          functionLimitList.setting.check.chkboxType = { "Y" : "ps", "N" : "ps" };//checkbox 选中/取消选中的时候关联到父子节点 p-父 s-子
Copy after login
<span style="color: #000000">}).error(function(){});

        };
        $scope.initZtreeData();
        function zTreeOnCheck(){
            $scope.getNodeDetail();
        };<br><br><br>//点击节点时执行的回调</span>
Copy after login
$scope.getNodeDetail = function () {
    var treeObj = $.fn.zTree.getZTreeObj("functionLimitList");
    var node = treeObj.getSelectedNodes();//点击节点后 获取节点数据
    $scope.id = node[0].id;

};
Copy after login
 <br>
Copy after login

Default selected node: (Note: The default selected method should be called after the tree is successful to ensure that each check is successful)

        $scope.roleZtreeDafultNodes = function () {var url = '/';//接口名var params = {// 参数            };
            $http.post(url,params).success(function(res){var list = [110101,110102];//res.data里 获取到的节点idfor(var i=0;i<list.length;i++){var node = zTree.getNodeByParam("id",list[i]);
                    zTree.checkNode(node);
                    zTree.expandNode(node, true, true,true);
                    zTree.selectNode(node);
                };
            }).error(function(){});

        };
        $scope.roleZtreeDafultNodes();
Copy after login

The above is the detailed content of Detailed explanation of angular ztree ladder structure. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template