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 @@