<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelDepartSingle.aspx.cs" Inherits="M_Main.DialogNew.SelDepartSingle" %>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.min.js"></script>
    <script src="../jscript/JSClient.js" type="text/javascript"></script>
    <script src="../jscript/jquery.tool.new.js" type="text/javascript"></script>
    <script src="../jscript/Dialog.js" type="text/javascript"></script>
    <link href="../css/framedialog_twocol.css" type="text/css" rel="stylesheet" />
    <link href="../css/button.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/icon.css" />
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/demo/demo.css" />
    <script type="text/javascript" src="../jscript/DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../Jscript-Ui/JQForm/JQForm.js"></script>
</head>
<body style="padding:5px;overflow-y:auto;">
    <form id="FrmForm" runat="server">
    <ul id="treeDemo" style="width:100%;" class="easyui-tree">
	</ul>
    <script type="text/javascript">
        $(document).ready(function () {
            function InitLeftTree() {
                        $.tool.DataGet('Choose', 'SelDepartmentSingle', "",
                        function Init() {
                        },
                        function callback(_Data) {
                            if (_Data != '') {
                                varObjects = eval("(" + _Data.replace(/\\/g, "/") + ")"); //转换为json对象
                                GetTree(varObjects);
                            }
                        },
                        function completeCallback() {
                        },
                        function errorCallback() {
                        });
            }
            function GetTree(obj) {
                $('#treeDemo').html("");
                $('#treeDemo').tree({
                    data: obj,
                    onSelect: function (node) 
                    {
                        var ReturnValue = node.attributes.DepCode + ',' + node.text + ',' + node.id;
                        HDialog.Close(ReturnValue);
                    }
                });
            }
            InitLeftTree();
        });
       
    </script>
    </form>
</body>
</html>
