From 3c841292c3464764eefa49e22056b14b81dba36d Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 22 Jun 2023 16:27:08 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EC=A0=9C?= =?UTF-8?q?=EB=AA=A9=20=ED=81=B4=EB=A6=AD=EC=8B=9C=20=EB=8F=99=EC=A0=81=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=EC=A1=B0=EA=B1=B4=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=ED=95=98=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/crdn/crdn06010-main.jsp | 4 +-- .../WEB-INF/jsp/fims/crdn/crdn06030-main.jsp | 35 ++++++++----------- .../js/fims/framework/cmm/initGrid.js | 19 ++++++++-- 3 files changed, 33 insertions(+), 25 deletions(-) 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 280429dc..0f00463c 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 @@ -89,9 +89,7 @@ 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 ee93ab53..b8d5248a 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 @@ -44,20 +44,14 @@
- - - - - - - + + +
+
+ + + +
@@ -227,7 +218,9 @@ $(document).ready(function(){ return { taskSeCd: 'DPV' - ,[form.find("[name='schOpt']").val()]: form.find("[name='schWord']").val() + ,vhrno : form.find("[name='vhrno']").val() + ,by : form.find("[name='by']").val() + ,term : form.find("[name='term']").val() ,schDateOpt: form.find("[name='schDateOpt']").val() ,schDateFrom: form.find("[name='schDateFrom']").val() ,schDateTo: form.find("[name='schDateTo']").val() @@ -261,6 +254,8 @@ $(document).ready(function(){ { header: 'interfaceSeqN', name: 'INTERFACE_SEQN', hidden: true } ]; thisPO.gridOptions = { + by : 'by--${pageName}', + byOutput : 'byOutput--${pageName}', theadTr: 'crdnTheadTr--${pageName}', rowHeader: 'No.', trDataKey: 'CRDN_ID', diff --git a/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js b/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js index 0b988841..9079545a 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js @@ -29,6 +29,7 @@ var initGrid = (gridOptions) => { gridColumns.forEach(function(item, idx, arr){ var gHeader = item.header; + var gName = item.name; var gWidth = item.width; if(!gWidth){ @@ -40,6 +41,14 @@ var initGrid = (gridOptions) => { gClass = ""; } + var titleClickEvent = ``; + + var by = gridOptions.by; + var byOutput = gridOptions.byOutput; + if(by && byOutput){ + titleClickEvent += `searchFromGridTitle('${by}','${byOutput}','${gName}','${gHeader}');`; + } + var gHidden = item.hidden; if(!gHidden){ gHidden = ""; @@ -53,6 +62,7 @@ var initGrid = (gridOptions) => { tabindex="0" rowspan="1" colspan="1" class="sorting ${gClass}" style="width: ${gWidth};" ${gHidden} + onclick="${titleClickEvent}" >${gHeader} `; @@ -61,7 +71,7 @@ var initGrid = (gridOptions) => { ondblclick="${gridOptions.dblClickEvent}" class="${gClass}" ${gHidden} - >{${item.name}} + >{${gName}} `; }); @@ -78,4 +88,9 @@ var initGrid = (gridOptions) => { tableBodyTemplate.notFound = notFound; return tableBodyTemplate; -}; \ No newline at end of file +}; + +function searchFromGridTitle(byElement, byOutputElement, byValue, byOutputValue){ + document.getElementById(byElement).value = byValue; + document.getElementById(byOutputElement).value = byOutputValue + " 검색"; +} \ No newline at end of file