From f645120641cdcd42506401c2942ad8c080b69a02 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Feb 2021 07:54:44 +0300 Subject: [PATCH] table helpers: don't try to iterate over a single element --- js/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/common.js b/js/common.js index f96ac8da4..7cbe1287b 100755 --- a/js/common.js +++ b/js/common.js @@ -201,7 +201,7 @@ const Tables = { }, select: function(elemId, selected) { - $(elemId).querySelector("tr").forEach((row) => { + $(elemId).querySelectorAll("tr").forEach((row) => { const checkNode = row.querySelector(".dijitCheckBox,input[type=checkbox]"); if (checkNode) { const widget = dijit.getEnclosingWidget(checkNode); @@ -219,7 +219,7 @@ const Tables = { getSelected: function(elemId) { const rv = []; - $(elemId).querySelector("tr").forEach((row) => { + $(elemId).querySelectorAll("tr").forEach((row) => { if (row.hasClassName("Selected")) { // either older prefix-XXX notation or separate attribute const rowId = row.getAttribute("data-row-id") || row.id.replace(/^[A-Z]*?-/, "");