Skip to content

Commit

Permalink
fix: replace some DOM Element functions not supported in Salesforce (#…
Browse files Browse the repository at this point in the history
…796)

- some methods aren't supported in Salesforce for unknown reasons and it throws some errors like "append method does not exist", however they can be easily replaced. `.append()` can be replaced by `.appendChild()` and `.replaceChildren()` can be replaced with our own custom `.emptyElement()` that was already used
  • Loading branch information
ghiscoding committed Jun 28, 2023
1 parent b458c23 commit e427bd2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ if (typeof Slick === "undefined") {
"cancelCurrentEdit": cancelCurrentEdit
};

_container.replaceChildren();
utils.emptyElement(_container);
_container.style.overflow = "hidden";
_container.style.outline = 0;
_container.classList.add(uid);
Expand Down Expand Up @@ -512,7 +512,7 @@ if (typeof Slick === "undefined") {
}

_focusSink2 = _focusSink.cloneNode(true);
_container.append(_focusSink2);
_container.appendChild(_focusSink2);

if (!options.explicitInitialization) {
finishInitialization();
Expand Down Expand Up @@ -1176,8 +1176,8 @@ if (typeof Slick === "undefined") {
});
});

_footerRowL.replaceChildren();
_footerRowR.replaceChildren();
utils.emptyElement(_footerRowL);
utils.emptyElement(_footerRowR);

for (var i = 0; i < columns.length; i++) {
var m = columns[i];
Expand Down Expand Up @@ -1224,8 +1224,8 @@ if (typeof Slick === "undefined") {
});
})

_headerL.replaceChildren();
_headerR.replaceChildren();
utils.emptyElement(_headerL);
utils.emptyElement(_headerR);

getHeadersWidth();

Expand All @@ -1246,8 +1246,8 @@ if (typeof Slick === "undefined") {
});
});

_headerRowL.replaceChildren();
_headerRowR.replaceChildren();
utils.emptyElement(_headerRowL);
utils.emptyElement(_headerRowR);

if (options.createFooterRow) {
const footerRowColumnElements = _footerRowL.querySelectorAll(".slick-footerrow-column");
Expand All @@ -1261,7 +1261,7 @@ if (typeof Slick === "undefined") {
});
}
});
_footerRowL.replaceChildren();
utils.emptyElement(_footerRowL);

if (hasFrozenColumns()) {
const footerRowColumnElements = _footerRowR.querySelectorAll(".slick-footerrow-column");
Expand All @@ -1275,7 +1275,7 @@ if (typeof Slick === "undefined") {
});
}
});
_footerRowR.replaceChildren();
utils.emptyElement(_footerRowR);
}
}

Expand Down

0 comments on commit e427bd2

Please sign in to comment.