I am facing the error while creating 900 columns in the table by using jsrender. I have used the below code.
var i = 0, htmlStr = "<tr style = 'height: {{:height}}px' idx = '{{:rowidx}}'>" , colgrp = document.createElement("colgroup"), templates ={obj:""};
while (i < 900) {
colWth = 20;
colHdr = "A" + 1;
col = document.createElement("col");
col.style["width"] = colWth + "px";
htmlStr += "<td class='{{:" + colHdr + "_className}}' rowspan=' {{:" + colHdr + "_rspan}}' colspan=' {{:" + colHdr + "_cspan}}'>{{:" + colHdr + "_value}}</td>";
colgrp.append(col);
i++;
}
templates["obj"] = htmlStr + "</tr>";
$.templates(templates);
While running the sample getting the error.
JsViewsError {name: "JsRender Error", message: "Syntax error↵Compiled template code:↵↵// obj↵var v…↵return ret;↵: "Maximum call stack size exceeded""}
The error occurring in > jsrender-1.0.0-beta.js < . Which is working fine in exact jsrender-1.0.0-beta.js version. Could you please suggest any solution to work in all the versions.
JSFiddle link: https://jsfiddle.net/z8fqs1yb/2/