티스토리 뷰
drop down list가 많이 나오면 찾기 힘들다.
그래서 drop down list에 검색이 나오게 하면 찾을 수 있어서 좋다.
jQuery Chosen 플러그인을 사용하면 쉽게 할 수 있다.
<link rel="stylesheet" href="<c:url value='/chosen/chosen.min.css'/">
<script src="<c:url value='/chosen/chosen.jqeury.min.js'/"></script>
<div id="chosen2">
<select id="deptSelect" name="deptCode" style="width:150px; display:none" class="chosen-select pull-right">
<option value=""></option>
</select>
</div>
<script type="text/javascript">
server("/depts",null,initDeptSelect);
function initDeptSelect(data){
var $option=$("#chosen2").find('option').detach();
if(data.success=='true'){
(function(temp,temp2,index){
$('#deptSelect').each(function(){
if(index==0){
$(this).append($option.clone());
$(this).append($option.clone().val(null).text('<spring:message code="system.entire"/>'));
}
$(this).append($option.clone().val(temp1).text(temp2));
})
})(this.deptCode, this.deptNm, index)
});
}
$("#deptSelect').chosen({
placeholder_text_single:'<spring:message code="system.select_department"/>',
inherit_select_class:true
});
}
</script>
'jquery' 카테고리의 다른 글
룰렛 소스코드 (0) | 2020.07.31 |
---|---|
html focus (0) | 2019.02.09 |
jquery 모달 modal 띄우고 닫기 (0) | 2018.10.11 |
[jQuery] td:eq(index) 테이블 선택 데이터 정보 가져오기 (0) | 2018.10.11 |
jquery serialize (0) | 2018.10.01 |
- Total
- Today
- Yesterday
- KG
- xe addon
- 포인터
- XE
- 자바
- C언어
- 파이썬
- esql
- 이클립스
- JDBC
- 라이믹스 모듈
- EC
- proc
- 플러터
- 프로씨
- XE3
- ocjap
- webix
- xe애드온
- C
- 문자열
- php
- MySQL
- ocajp
- 오라클
- 스크래핑
- 파싱
- 자바 smtp
- Python
- 인포믹스
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |