2010년 12월 03일
jstl과 javascript,jquery 결합
<script type="text/javascript">
var arrDeptList = [
<c:forEach var="dataList" items="${deptPickupVOList}" varStatus="status">
{
value : "${dataList.dept_cd}",
label : "${dataList.dept_nm}"
}
<c:if test="${not status.last}">,</c:if>
</c:forEach>
];
$(document).ready(function(){
/*
* autocomplete 부분
*/
$("#deptselect").autocomplete({
source: arrDeptList,
focus: function( event, ui ) {
$( "#deptselect" ).val( ui.item.label );
return false;
},
select: function( event, ui ) {
$( "#dept_cd" ).val( ui.item.value );
$( "#dept_nm" ).val( ui.item.label );
return false;
}
});
});
</script>
# by | 2010/12/03 11:40 | Jsp&Script | 트랙백 | 덧글(0)




