From 7563adf9955b43def5bd9a53ff00eabb6b16f402 Mon Sep 17 00:00:00 2001 From: leebj Date: Wed, 31 Jul 2024 10:28:42 +0900 Subject: [PATCH] =?UTF-8?q?=ED=86=B5=ED=95=A9=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EC=B2=B4=ED=81=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EC=B2=98=EB=A6=AC=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 | 54 ++++++++++++++++++- .../WEB-INF/jsp/fims/sprt/sprt01014-info.jsp | 2 +- .../WEB-INF/jsp/fims/sprt/sprt01015-info.jsp | 2 +- .../WEB-INF/jsp/fims/user/user01010-main.jsp | 24 ++++----- 4 files changed, 67 insertions(+), 15 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 24e5dfee..0ddcc3c2 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 @@ -123,6 +123,16 @@ $(document).ready(function() { var checkbox = $(this); checkbox.prop("checked", keys.includes(checkbox.val())); }); + + let status = getCheckboxesStatus($("#upTbody--${pageName}").find("input[type='checkbox']")); + let thc = $("#upTheadTr--${pageName}").find("input[type='checkbox']"); + + if(status == 1 && !thc.is(":checked")){ + thc.prop("checked", true); + } else if(status == -1 && thc.is(":checked")){ + thc.prop("checked", false); + } + }; $P.integrationSearchControl.downDataset.onSelectionChange = (selectedArr) => { @@ -133,8 +143,37 @@ $(document).ready(function() { var checkbox = $(this); checkbox.prop("checked", keys.includes(checkbox.val())); }); + + let status = getCheckboxesStatus($("#downTbody--${pageName}").find("input[type='checkbox']")); + let thc = $("#downTheadTr--${pageName}").find("input[type='checkbox']"); + + if(status == 1 && !thc.is(":checked")){ + thc.prop("checked", true); + } else if(status == -1 && thc.is(":checked")){ + thc.prop("checked", false); + } }; - + + //그리드 체크박스 + $P.selectCheckbox = (obj, arg1, arg2) => { + + let table = $(obj).parent().parent().parent().parent(); + let id = table[0].id; + if(id.startsWith("up")){ + if(arg2 != null){ + pageObject['${pageName}'].integrationSearchControl.upDataset.select(arg1, arg2); + } else { + pageObject['${pageName}'].integrationSearchControl.upDataset.select(arg1); + } + } else if(id.startsWith("down")){ + if(arg2 != null){ + pageObject['${pageName}'].integrationSearchControl.downDataset.select(arg1, arg2); + } else { + pageObject['${pageName}'].integrationSearchControl.downDataset.select(arg1); + } + } + } + $P.toast = new bootstrap.Toast(document.getElementById('divToast--${pageName}'), { animation: true, autohide: true, @@ -859,4 +898,17 @@ $(document).ready(function() { }); +function getCheckboxesStatus($checkboxes){ + + if($checkboxes.length == 0){ + return 0; + } + + if($checkboxes.filter(":checked").length == $checkboxes.length){ + return 1; + } else { + return -1; + } + +} diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01014-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01014-info.jsp index 72925f33..190f7281 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01014-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01014-info.jsp @@ -7,7 +7,7 @@ + onchange="pageObject['${pageName}'].selectCheckbox(this, this.checked);"> + onchange="pageObject['${pageName}'].selectCheckbox(this,'{CRDN_ID}', this.checked);"> {SGG_NM} {TASK_SE_NM} diff --git a/src/main/webapp/WEB-INF/jsp/fims/user/user01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/user/user01010-main.jsp index ddbf5c42..3617b7c5 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/user/user01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/user/user01010-main.jsp @@ -206,7 +206,7 @@
- +
@@ -237,10 +237,10 @@