You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
116 lines
3.6 KiB
116 lines
3.6 KiB
<%@ |
|
page contentType="text/html; charset=UTF-8" |
|
import="kr.co.kihyun.beans.user.HttpSSOLogin" |
|
import="kr.co.kihyun.moumi.Moumi" import="kr.co.kihyun.lang.MString" |
|
import="kr.co.kihyun.lang.MLong" import="kr.co.kihyun.beans.user.Dept" |
|
import="kr.co.kihyun.beans.user.PartList" |
|
%> |
|
<% |
|
String rootId=request.getParameter("rootID"); |
|
String keyWord=request.getParameter("keyWord"); |
|
%> |
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
<head> |
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|
<script type="text/javascript" src="/test/jquery-1.6.4.js"></script> |
|
<script type="text/javascript" src="/test/_lib/jquery.cookie.js"></script> |
|
<script type="text/javascript" src="/test/_lib/jquery.hotkeys.js"></script> |
|
<script type="text/javascript" src="/test/jquery.jstree.js"></script> |
|
<style> |
|
#newTree { text-align: justify; font-size:9pt; vertical-align:middle; } |
|
</style> |
|
</head> |
|
<body> |
|
<input type="button" class="button" value="Search" id="search" style="" /> |
|
<input type="button" class="button" value="Search clear" id="searchClear" style="" /> |
|
<input type="button" class="button" value="checked Id" id="checkbtn" style="" /> |
|
<div id="searchResult" class="searchResult"></div> |
|
<div id="newTree" class="newTree"></div> |
|
|
|
<script type="text/javascript" class="source"> |
|
$(function() { |
|
$("#newTree").jstree({ |
|
"json_data" : { |
|
"data" : [ |
|
{ |
|
"data" : "조직도", |
|
"state" : "closed", |
|
"attr" : { "id" : "ROOT","rel":"ROOT","rootid":'<%=rootId%>' } |
|
} |
|
], |
|
"ajax" : { |
|
"url" : "/servlet/kr.co.kihyun.tree.Tree", |
|
"data" : function(n) { |
|
var data={}; |
|
data.id=n.attr("id"); |
|
data.rootId=n.attr("rootId"); |
|
return data; |
|
} |
|
}, |
|
"progressive_render" : true |
|
}, |
|
"types" : { |
|
"valid_children" : ["ROOT","DEPT","USER"], |
|
"types" : { |
|
"ROOT" : { |
|
"icon" : { "image" : "/totsys/common/images/pc-user.gif" }, |
|
}, |
|
"USER" : { |
|
"icon" : { "image" : "/totsys/common/images/person.png" } |
|
} |
|
}, |
|
}, |
|
"plugins" : ["themes","json_data","checkbox","search","types","ui","core"], |
|
"checkbox" : { state_type : "three-state" }, |
|
"themes" : { |
|
"theme":"classic", |
|
"dots":true, |
|
"icons":true, |
|
"url" : "/test/themes/classic/style.css" |
|
}, |
|
"search" : { |
|
"case_insensitive" : true, |
|
"ajax" : { |
|
"url" : "/servlet/kr.co.kihyun.tree.TreeSearch", |
|
"data": function(str) { |
|
var data={}; |
|
data.keyWord=str; |
|
data.startId=encodeURIComponent('<%=rootId%>'); |
|
return data; |
|
}, |
|
"async" : false, |
|
"success" : function(data) { |
|
} |
|
} |
|
} |
|
}).bind("search.jstree",function(e,data) { |
|
$("#searchResult").html('<strong>'+data.rslt.nodes.length+'</strong>'+' 건 검색완료'); |
|
}); |
|
$("#newTree").bind("load_node.jstree",function(e,data) { |
|
$(this).find('LI[SELTYPE=0]').find('.jstree-checkbox:first').hide(); |
|
}); |
|
$("#newTree").bind("select_node.jstree",function(e,data) { |
|
alert(data.rslt.obj.attr("id")); |
|
}); |
|
$("#newTree").bind("check_node.jstree",function(e,data) { |
|
data.inst.open_node(data.rslt.obj,false,true); |
|
}); |
|
$("#search").click(function () { |
|
$("#newTree").jstree("search","<%=keyWord%>"); |
|
}); |
|
$("#searchClear").click(function () { |
|
$("#newTree").jstree("clear_search"); |
|
$("#searchResult").empty(); |
|
}); |
|
$("#checkbtn").click(function () { |
|
$("#newTree").jstree("get_checked",null,true).each(function(){ alert(this.id); }); |
|
}); |
|
}); |
|
|
|
</script> |
|
|
|
</body> |
|
</html>
|
|
|