<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelItem.aspx.cs" Inherits="M_Main.DialogNew.SelItem" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>选择项目</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache,  must-revalidate">
    <meta http-equiv="Expires" content="0">
    <script type="text/javascript" src="../jscript/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="../jscript/jquery.ztree.core-3.5.js"></script>
    <link href="../css/style.css" type="text/css" rel="stylesheet">
    <script language="javascript" src="../jscript/JSClient.js"></script>
    <link href="../css/zTreeStyle/zTreeStyle.css" type="text/css" rel="stylesheet">
    <script src="../Jscript-Ui/hplus/js/plugins/layer/layer.min.js"></script> 
    <script src="../jscript/Dialog.js" type="text/javascript"></script>
    <base target="_self">
    <link href="../css/dialog.css" type="text/css" rel="stylesheet" style="overflow-y: scroll;">
</head>
<body ms_positioning="GridLayout" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">
    <form id="DepartmentDlg" method="post" runat="server">
        <table class="formTable" id="Table1" cellspacing="1" cellpadding="4" align="center" style="height: auto;">
            <tr>
                <td class="formTable_Header" align="center">
                    <span id="lbl_WorkflowName">选择项目</span>
                </td>
            </tr>
            <tr>
                <td class="formTable_ItemInput">
                    <div id="divMenuTree" style="height: 450px; width: 100%">
                        <ul id="treeDemo" class="ztree">
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td height="3"></td>
            </tr>
            <tr>
                <td height="30" class="formTable_Footer" align="center">
                    <input id="btnSelect" onclick="javascript:btnOK_onclick();" type="button" value="选择"
                        name="btnFilter" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                <input id="btnReturn" onclick="javascript:self.returnValue='\t';self.close();" type="button"
                    value="放弃选择" name="btnReturn" class="button_four">
                </td>
            </tr>
        </table>
        <script type="text/javascript">
            //加载项目节点
            function getFont(treeId, node) {
                return node.font ? node.font : {};
            }
            function btnOK_onclick(strNodeData) {
                if (strNodeData != ""){
                    HDialog.Close(strNodeData);
                }
                else{
                    alert("请选择项目!");
                }
            }
            var setting = {
                data: {
                    simpleData: {
                        enable: true,
                        idKey: "OrganCode",
                        pIdKey: "PrentOrganCode"
                    },
                    key: {
                        name: "OrganName"
                    }
                },
                view: {
                    fontCss: getFont,
                    nameIsHTML: true
                }
            };
            var n =<%= zNodes %>;
            var newN=[];
            for(var i=0;i<n.length;i++)
            {
                var strData="";
                strData=n[i]["OrganCode"]+","+n[i]["OrganName"]+","+n[i]["InPopedom"];
                newN[i]={OrganCode:n[i]["OrganCode"],PrentOrganCode:n[i]["PrentOrganCode"],OrganName:n[i]["OrganName"],click:"btnOK_onclick('"+strData+"')", open:'true'};
            }
            var treeObj = $.fn.zTree.init($("#treeDemo"), setting, newN);
        </script>
    </form>
</body>
</html>
