zoukankan      html  css  js  c++  java
  • 展开easyui 树节点到某个点

     $(function () {
                $('#tt').tree({
                    url: '/IS/Department/JsonTree?companyID=@(Request.QueryString["companyID"])',
                    lines: true,
                    dnd: true,
                    onSelect: function (node) {
                        add(node.id, null);
                        $(this).tree('expand', node.target);  //点击树节点,展开子级节点
                    },
                    onLoadSuccess: function (node, data) {
                        if (selectID > 0) {
                            var root = $(this).tree("find", selectID); 
                            $(this).tree("expandTo", root.target); //展开到某个节点  ,注意这里如果用 $("#tt") 则功能无法实现
                        }
                    }, onDrop: function (targetNode, source, point) {
                        debugger;
                        if ("append" == point) {
                            var targetId = $('#tt').tree('getNode', targetNode).id;
    
                            $.ajax({
                                url: "/IS/Department/UpdateParent",
                                data: { targetId: targetId, sourceid: source.id },
                                success: function () {
    
                                }
                            })
                        }
                    }
    
                });
    
                $('#ParentDepartment').combotree('setValue', '@Model.ParentDepartmentID');
            });
  • 相关阅读:
    Kth Smallest Element in a BST
    Bitwise AND of Numbers Range
    Happy Number
    Summary Ranges
    linux设置MySQL开机自动启动
    基本PSO算法实现(Java)
    Invert Binary Tree
    Rectangle Area
    Contains Duplicate II
    Contains Duplicate
  • 原文地址:https://www.cnblogs.com/vincentvoid/p/6256387.html
Copyright © 2011-2022 走看看