From 746c899280c3b3399cd1b70d6a478399ba41c271 Mon Sep 17 00:00:00 2001 From: leebj Date: Tue, 27 Aug 2024 10:17:51 +0900 Subject: [PATCH] =?UTF-8?q?DatasetControl=20keyMapper=20=EC=84=A4=EC=A0=95?= =?UTF-8?q?=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/sprt/sprt01010-main.jsp | 33 ++++++++------- .../WEB-INF/jsp/fims/sprt/sprt01015-info.jsp | 6 +-- .../WEB-INF/jsp/fims/sprt/sprt01100-info.jsp | 18 ++++----- .../WEB-INF/jsp/fims/sprt/sprt01110-info.jsp | 40 ++++++++++--------- .../WEB-INF/jsp/fims/sprt/sprt01120-info.jsp | 37 +++++++++-------- .../WEB-INF/jsp/fims/sprt/sprt01140-info.jsp | 37 +++++++++-------- .../WEB-INF/jsp/fims/sprt/sprt01150-info.jsp | 35 ++++++++-------- .../resources/js/fims/sprt/sprt01010.js | 2 +- 8 files changed, 106 insertions(+), 102 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp index dc43cbd0..2cbef4df 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp @@ -63,16 +63,18 @@ $(document).ready(function() { }; // 현재 선택 자료 변경 이벤트 - ctrl.upDataset.onCurrentChange = (DI) => { - if (!DI) return; - var key = DI.data.CRDN_ID; - $P.$findn("upTbody").setCurrentRow(key); + ctrl.upDataset.onCurrentChange = (dataItem) => { + if (!dataItem) { + return; + } + $P.$findn("upTbody").setCurrentRow(dataItem.index); }; - ctrl.downDataset.onCurrentChange = (DI) => { - if (!DI) return; - var key = DI.data.CRDN_ID; - $P.$findn("downTbody").setCurrentRow(key); + ctrl.downDataset.onCurrentChange = (dataItem) => { + if (!dataItem) { + return; + } + $P.$findn("downTbody").setCurrentRow(dataItem.index); }; // 선택(체크) 변경 이벤트 @@ -290,11 +292,11 @@ $(document).ready(function() { var replacer; if(updown == "up"){ replacer = (str, dataItem) => str - .replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.upDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');") + .replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.upDataset.setCurrent('{DATA-INDEX}');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');") } else { replacer = (str, dataItem) => str - .replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.downDataset.setCurrent('" + dataItem.getValue("CRDN_ID") + "');") + .replace(/{onclick}/gi, "pageObject['${pageName}'].ctrl.downDataset.setCurrent('{DATA-INDEX}');") .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getInfo('"+ dataItem.getValue("TASK_SE_CD") +"','" + dataItem.getValue("CRDN_ID") + "');") } @@ -758,17 +760,20 @@ $(document).ready(function() { var downDataset = ctrl.downDataset; if(upDataset.length > 0){ - var info = upDataset.getData(crdnId); - if(info != null){ + let filtered = upDataset.getDataset("item").filter(item=>item.data.CRDN_ID == crdnId); + if(filtered != null && filtered.length > 0){ + let info = upDataset.getData(filtered[0].index); return info; } } if(downDataset.length > 0){ - var info = downDataset.getData(crdnId); - if(info != null){ + let filtered = downDataset.getDataset("item").filter(item=>item.data.CRDN_ID == crdnId); + if(filtered != null && filtered.length > 0){ + let info = downDataset.getData(filtered[0].index); return info; } + } return null; diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01015-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01015-info.jsp index a207e27a..ca6aa382 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01015-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01015-info.jsp @@ -4,10 +4,10 @@ 통합조회 그리드 템플릿(내용)