<script type="text/javascript">
<!--
c = new dTree('c');
c.add(0,-1,'코드 목록');
<%
int order = 0;
List codeOneList = (List)request.getAttribute(oneCodeList");
Map row = null;
String nowID = "";
String parentID = "";
String codeNm = "";
String sort = "";
String levl = "";
String del = "";
String newNm = "";
String grup = "";
int count=0;
if ( codeOneList != null || ! codeOneList.isEmpty() ){
for(int i = 0;i < codeOneList.size();i++){
row = ut.getResultNullChk((Map)codeOneList.get(i));
//row2 = ut.getResultNullChk((Map)codeTwoList.get(i));
nowID = (String)row.get("CD_NO");
parentID = (String)row.get("REF_CD_NO");
codeNm = (String)row.get("CD_NM");
for(int l=0; l<codeNm.length(); l++){ // 이름에 '," 가 들어갈 경우 스크립트에서 전체 문자열을 인식하지 못하는 문제가 생김
char ch = codeNm.charAt(l);
if(ch == '\'' || ch == '\"'){
newNm = newNm+"\\"+ch;
}
else if(ch == '\r' || ch == '\n'){
newNm = newNm;
}
else{
newNm = newNm+ch;
}
}
if(newNm.length() > codeNm.length() && !codeNm.equals(newNm)) codeNm = newNm;
newNm = "";
del = (String)row.get("DEL_YN");
sort = (String)row.get("CD_SORT_ORDR");
levl = (String)row.get("CD_CLSF_LEVL");
grup = (String)row.get("GRUP_CD_NO");
if(levl.equals("0")){
order = 0;
}
else{
if(order == 0) order = i;
}
%>
c.add(<%=i+1 %>, <%=order %>, '<%=codeNm%>', "javascript:selectCode(document.code_form, '<%=nowID %>', '<%=codeNm%>', '<%=parentID %>', '<%=levl%>', '<%=sort%>', '<%=del%>', '<%=grup%>');", '<%=nowID%>', '<%=parentID%>');
<%
}
}
%>
document.write(c);
//c.s(0);
//c.closeAll();
//-->
</script>
'JSP·script·jquery' 카테고리의 다른 글
ajax 사용 후 json 데이터 jsp 에서 핸들링 (0) | 2013.12.01 |
---|---|
jquery ajax 데이터 json으로 받기 (0) | 2013.11.28 |
jquery 부모창 스크립트 호출 및 값 넘기기 (0) | 2013.11.27 |
jsp 페이지 단에서 ssl http 에서 https 로 변경하기 (0) | 2013.11.01 |
나를 호출한 페이지 정보 찾기 (0) | 2013.10.01 |