From 6d62f134e5fe4c11b345ea5e5ecf5e88be152d32 Mon Sep 17 00:00:00 2001 From: jjh Date: Thu, 19 Sep 2024 09:55:35 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=84=EB=8C=80=EA=B8=B0=EC=97=85=EB=A7=A4?= =?UTF-8?q?=ED=95=91=20=EC=A0=95=EB=B3=B4=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/rent/rent01020-info.jsp | 7 ++--- .../resources/js/fims/rent/rent01020.js | 26 +++++++++++++++++-- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/fims/rent/rent01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/rent/rent01020-info.jsp index 15e695a6..2cb5fe9c 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/rent/rent01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/rent/rent01020-info.jsp @@ -138,8 +138,6 @@ // pageObject let $P = pageObject["${pageName}"]; - // formFields - $P.formFields = new FimsFormFields($P.selectorn("frmEdit")); // datasetControl $P.ctrl = newRent01020Control("${pageName}", "[data-doctx=${pageName}]"); // main에서 호출한 파라미터 @@ -150,9 +148,8 @@ **************************************************************************/ // URL 설정 $P.fnSetUrl = (prefixUrl) => { -// $P.ctrl.urls.load = wctx.url(prefixUrl + "/020/reload.do"); // - $P.ctrl.urls.load = wctx.url(prefixUrl + "/020/info.do"); // - $P.ctrl.urls.getInfo = wctx.url(prefixUrl + "/040/info.do"); // 상세 정보 + $P.ctrl.urls.load = wctx.url(prefixUrl + "/020/info.do"); // 상세 정보 조회 + $P.ctrl.urls.getInfo = wctx.url(prefixUrl + "/040/info.do"); // 상세 정보 조회 } /************************************************************************** diff --git a/src/main/webapp/resources/js/fims/rent/rent01020.js b/src/main/webapp/resources/js/fims/rent/rent01020.js index 5add239d..82da041b 100644 --- a/src/main/webapp/resources/js/fims/rent/rent01020.js +++ b/src/main/webapp/resources/js/fims/rent/rent01020.js @@ -18,8 +18,10 @@ function newRent01020Control(pageName, doctx="[data-doctx='rent01020']") { ctrl.onCurrentChange = (item) => { if (!item) return; + let formFields = new FimsFormFields(ctrl.selector("[name='frmEdit']")); + // 화면에 Dataset 셋팅 - pageObject[pageName].formFields.set(ctrl, item); + formFields.set(ctrl, item); }; // 상세 정보 dialog @@ -45,10 +47,12 @@ function newRent01020Control(pageName, doctx="[data-doctx='rent01020']") { AppSupport.setDialogZindex(); } , onClose: () => { + // 자료 재조회 ctrl.query.callPurpose = "reload"; + + ctrl.refreshInfo(ctrl.query); // 오류 발생됨. 한실장님 다시 확인. // ctrl.reload(); - // ctrl.load(1); } }); @@ -56,5 +60,23 @@ function newRent01020Control(pageName, doctx="[data-doctx='rent01020']") { }); } + ctrl.refreshInfo = (params) => { + if (!params) return; + + ajax.get({ + url: ctrl.urls.load + , headers: { Accept: "application/json; charset=utf-8" } // json + , data: params || {} + , success: (resp) => { + // 초기화 + ctrl.find("[name='frmEdit']").reset(); // 화면 초기화 + ctrl.dataset.clear(); // Dataset 초기화 + + // Dataset 셋팅 + ctrl.setData([resp.Info]); // 정보 + } + }); + } + return ctrl; }