페이지별 datepicker 초기화 함수 추가

main
이범준 1 year ago
parent f79d10c122
commit f09fc1172c

@ -298,25 +298,16 @@ $(document).ready(function(){
thisPO.tbodyTemplate = {};
//페이지로딩 후 초기화
//그리드 정보 초기화
thisPO.tbodyTemplate = initGrid(thisPO.gridOptions);
$("#schDateFrom--${pageName}").datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true
});
$("#schDateTo--${pageName}").datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true
});
//달력 초기화
initDatepicker("frmSearch--${pageName}");
$('#schDateFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schDateTo--${pageName}').datepicker('setDate', new Date());
$( "#frmSearch--${pageName} .form-date" ).next("button.bx-calendar").on("click", function() {
$(this).prev().focus();
});
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();
$("#frmSearch--${pageName} input[name='taskSeCd'][value='" + defaultBizValue + "']").prop("checked",true);

@ -273,26 +273,15 @@ $(document).ready(function(){
thisPO.tbodyTemplate = {};
//페이지로딩 후 초기화
//그리드 정보 초기화
thisPO.tbodyTemplate = initGrid(thisPO.gridOptions);
$("#schDateFrom--${pageName}").datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true
});
$("#schDateTo--${pageName}").datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true
});
//달력 초기화
initDatepicker("frmSearch--${pageName}");
$('#schDateFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
$('#schDateTo--${pageName}').datepicker('setDate', new Date());
$( "#frmSearch--${pageName} .form-date" ).next("button.bx-calendar").on("click", function() {
$(this).prev().focus();
});
//스크롤 이벤트 추가

@ -47,7 +47,7 @@
<!-- 데이트픽커 -->
<script src="<c:url value="/resources/lib/fims/framework/datepicker/datepicker.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/fims/framework/cmm/initDatepicker.js?${ver}"/>"></script>
<!-- 그리드 템플릿 설정 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/initGrid.js"/>?${ver}"></script>

@ -0,0 +1,17 @@
function initDatepicker(elementId){
var executionArea = $("#"+elementId);
/*--------------------- 달력 제어 ---------------------*/
executionArea.find(".form-date").datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true
});
executionArea.find(".form-date").next("button.bx-calendar").on("click", function() {
$(this).prev().focus();
});
}
Loading…
Cancel
Save