jsGanttImproved / jsgantt-improved

Javascript Gantt: fully featured gantt chart component built entirely with JS and CSS. No images or external libs required.
https://jsganttimproved.github.io/jsgantt-improved
Other
483 stars 249 forks source link

appendChild(document.createElement(pNodeType)) is not a function #345

Open RudiSchloesser opened 3 years ago

RudiSchloesser commented 3 years ago

Version 2.8.2 raise the exception "appendChild is not a function" at line 4174.

 var vNewNode = pParent.appendChild(document.createElement(pNodeType));

By replacing this with:

var vNewNode = document.createElement(pNodeType);
pParent.append(vNewNode);
if (pAttribs) {
    for (var i = 0; i + 1 < pAttribs.length; i += 2) {
        vNewNode.setAttribute(pAttribs[i], pAttribs[i + 1]);
    }
}

fixes this problem and also the error, that vNewNode is "undefined".