<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="cm" uri="/commons-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>角色管理</title>
<s:include value="../common/head.jsp" />
<link href="../resources/js/ztree/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../resources/js/ztree/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../resources/js/ztree/jquery-ztree-2.4.min.js"></script>
  <script type="text/javascript">
	var zNodes = [
		<s:iterator value="emplOrgList" status="st">
			{"id":"<s:property value='id'/>", "pid":"<s:property value='parent.id'/>", "name":"<s:property value='name'  escape='false' escapeJavaScript='true'/> [<s:property value='manager.name' escape='false' escapeJavaScript='true'/>]"} 
			<s:if test="#st.index!=(emplOrgList.size()-1)">,</s:if>
		</s:iterator>
	];
	//////////////
	var zTree;
	var setting = { 
    	isSimpleData : true,
    	treeNodeKey : "id",
    	treeNodeParentKey : "pid",	
		checkable: false,
		expandSpeed: "fast", 
		showLine: true,
		callback:{
			click: zTreeOnClick
		}
	};

	$(document).ready(function(){
		zTree = $("#treeBox").zTree(setting, zNodes);
		zTree.expandAll(true);
	});
		
	function zTreeOnClick(event, treeId, treeNode) {
		parent.selectEmplOrg(treeNode.id);
	}

  </script> 
</head>

<body style=" background-color:#FFF;">
<ul id="treeBox" class="tree"></ul>
</body>
</html>