展開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');
        });

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM