table helpers: don't try to iterate over a single element
This commit is contained in:
parent
d26269865f
commit
f645120641
|
@ -201,7 +201,7 @@ const Tables = {
|
||||||
|
|
||||||
},
|
},
|
||||||
select: function(elemId, selected) {
|
select: function(elemId, selected) {
|
||||||
$(elemId).querySelector("tr").forEach((row) => {
|
$(elemId).querySelectorAll("tr").forEach((row) => {
|
||||||
const checkNode = row.querySelector(".dijitCheckBox,input[type=checkbox]");
|
const checkNode = row.querySelector(".dijitCheckBox,input[type=checkbox]");
|
||||||
if (checkNode) {
|
if (checkNode) {
|
||||||
const widget = dijit.getEnclosingWidget(checkNode);
|
const widget = dijit.getEnclosingWidget(checkNode);
|
||||||
|
@ -219,7 +219,7 @@ const Tables = {
|
||||||
getSelected: function(elemId) {
|
getSelected: function(elemId) {
|
||||||
const rv = [];
|
const rv = [];
|
||||||
|
|
||||||
$(elemId).querySelector("tr").forEach((row) => {
|
$(elemId).querySelectorAll("tr").forEach((row) => {
|
||||||
if (row.hasClassName("Selected")) {
|
if (row.hasClassName("Selected")) {
|
||||||
// either older prefix-XXX notation or separate attribute
|
// either older prefix-XXX notation or separate attribute
|
||||||
const rowId = row.getAttribute("data-row-id") || row.id.replace(/^[A-Z]*?-/, "");
|
const rowId = row.getAttribute("data-row-id") || row.id.replace(/^[A-Z]*?-/, "");
|
||||||
|
|
Loading…
Reference in New Issue