<%@include file="/WEB-INF/common/layouts/common.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<html> 
<head>
    <title>转移部门</title>
</head>
<body>
<link type="text/css" href="${ctx}/resources/customize/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet">
<div class = "container" style="margin-top:-50px;"> 
 	<div class="row${fluid} span3">
		<div >
		<!-- 	<div class="form-horizontal house365Page">
				<div class="house365Border"> -->
               		<!-- 片段头 begin -->
					<!-- <div class="sectionTitle">
								<h5 class="span11">转移部门，员工是李虎</h5>
								<a  class="span1 btn  btn-primary">保存</a>
					</div> -->
                   <!--  <div class="row-fluid"> -->
                     	<div  class="span1 control-group">
                        </div> 
                         <div id="transferTreeContainer" class="span2 control-group">
                        </div> 
                   <!--  </div> -->
			    <!-- </div>               
            </div> -->
       </div>   
	</div>
</div>

<script src="${ctx}/resources/customize/zTree/js/jquery.ztree.all-3.5.js"></script>
<script src="${ctx}/resources/customize/zTree/js/tree.common.js"></script>




<script type="text/javascript">
$(document).ready(function() {
        var zNodes = [
            <c:forEach items="${trees}" var="m">
            {
                "id": "${m.id}",
                "pId": "${m.parentId}",
                "name": "${m.name}",
                "open": true,
                "root": ${m.root}
            },
            </c:forEach>
        ];

        $.zTree.initMovableTree({
            zNodes: zNodes,
            urlPrefix: "${ctx}/department",
            async: true,
            onlyDisplayShow: ${empty param['show'] ? '0' : param['show']},
            autocomplete: {
                enable: false
            },
            editable: false,//$("#treeEditFlag").is(":checked"),
            containerId: 'transferTreeContainer',
            maxLevel: 10,
            check: {
                enable: true,
                chkStyle: "radio",
                radioType: "all"
            },
            setting: {
                callback: {
                	onCheck:function(event, treeId, treeNode) {
                	    console.log(treeNode.id + ", " + treeNode.name + "," + treeNode.checked+","+treeId);
                	}
                }
            }
        });

    });
</script>
</body>