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;