From 0091935e2f2fa13773421e278c98d84892a0ed94 Mon Sep 17 00:00:00 2001 From: leebj Date: Fri, 9 Aug 2024 11:11:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B2=B4=ED=81=AC=EB=B0=95=EC=8A=A4=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/js/fims/cmmn/fims-cmmnUtil.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js b/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js index 342d270c..842cdc35 100644 --- a/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js +++ b/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js @@ -479,13 +479,23 @@ const GRID = { } }, countChecked : function(checkboxElement){ + var parentEl = $(checkboxElement).parent()[0]; var tr = $(checkboxElement).parents("tr"); - var siblings = tr.find("TD"); - var checkboxColIndex = siblings.index(parentEl); - var table = $(checkboxElement).parents("table"); - var tbody = table.find("tbody"); + + var checkboxColIndex = null; + if(parentEl.tagName == "TH"){ + var siblings = tr.find("TH"); + checkboxColIndex = siblings.index(parentEl); + } else if(parentEl.tagName == "TD"){ + var siblings = tr.find("TD"); + checkboxColIndex = siblings.index(parentEl); + } else { + return null; + } + + var tbody = table.find("tbody"); var trs = tbody.find("tr"); var count = 0;