diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp index 21d073cf..280429dc 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp @@ -298,26 +298,17 @@ $(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); thisPO.fnResetAndChangeBiz(defaultBizValue); diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp index 0db1690f..ee93ab53 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp @@ -273,26 +273,15 @@ $(document).ready(function(){ thisPO.tbodyTemplate = {}; - //페이지로딩 후 초기화 + //그리드 정보 초기화 thisPO.tbodyTemplate = initGrid(thisPO.gridOptions); + + //달력 초기화 + initDatepicker("frmSearch--${pageName}"); - $("#schDateFrom--${pageName}").datepicker({ - changeMonth: true, - changeYear: true, - showButtonPanel: true - }); - $("#schDateTo--${pageName}").datepicker({ - changeMonth: true, - changeYear: true, - showButtonPanel: true - }); $('#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(); - }); - //스크롤 이벤트 추가 diff --git a/src/main/webapp/WEB-INF/jsp/include/tail.jsp b/src/main/webapp/WEB-INF/jsp/include/tail.jsp index 6f2c294e..1ee6b930 100644 --- a/src/main/webapp/WEB-INF/jsp/include/tail.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/tail.jsp @@ -47,7 +47,7 @@ - + diff --git a/src/main/webapp/resources/js/fims/framework/cmm/initDatepicker.js b/src/main/webapp/resources/js/fims/framework/cmm/initDatepicker.js new file mode 100644 index 00000000..e2b550a4 --- /dev/null +++ b/src/main/webapp/resources/js/fims/framework/cmm/initDatepicker.js @@ -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(); + }); + +} + \ No newline at end of file