If have 6 treegrids with 5/6 working just fine. Using dhtmlx 4.6.1 Enterprise
The sixth is resulting in a too much recursion error on cells/cells2/cellById/cellByIndex calls.
simple treegrid defined identical to others…
tg.setHeader("#master_checkbox,col1,col2,col3",
null,
["text-align:right;","text-align:left;","text-align:center;",
"text-align:center;","text-align:left;"]);
tg.setInitWidths("30,*,180,180,150"); //set column width in px
tg.setColAlign("right,left,center,center,center"); // columns are set separately from header...
tg.enableResizing("false,false,false,false,false");
tg.setColTypes("ch,tree,html,html,html"); //set column types
tg.enableTooltips("false,false,true,true,true");
tg.enableEditEvents(false, false, false, false, false);
I’ve tracked it down to the following code:
dhtmlXGridObject.prototype.startFastOperations = function(){
this._disF=[“setSizes”,“callEvent”,"_fixAlterCss",“cells4”,“forEachRow”, “_correctMonolite”];
this._disA=[];
for (var i = this._disF.length - 1; i >= 0; i–){
this._disA[i]=this[this._disF[i]]; this[this._disF[i]]=function(){return true};
};
this._cellCache=[];
this.cells4=function(cell){
var c=this._cellCache[cell._cellIndex]
if (!c){
c=this._cellCache[cell._cellIndex]=this._disA[3].apply(this,[cell]);
c.destructor=function(){return true;}
c.setCValue=function(val){c.cell.innerHTML=val;}
}
c.cell=cell;
c.combo=cell._combo||this.combos[cell._cellIndex];
return c;
}
}
In particular _disA[3] is defined as cells4… which results in a recursive call to the same function with the same parameter. Thus the too much recursion error. Even with cells that are empty (a blank string) they result in this error.
Any idea what could result in this situation?
btw, html is handled by the following:
// Define custom style for dhtmlx grid cell
function eXcell_html(cell) { // excell name is defined here
if (cell) { // default pattern, just copy it
this.cell = cell;
this.grid = this.cell.parentNode.grid;
}
this.edit = function() {
}; // read-only cell doesn’t have edit method
this.isDisabled = function() {
return true;
}; // the cell is read-only, that’s why it is always in the disabled state
this.setValue = function(val) {
var title = “”;
// pull out the titles from all elements that may be in this val
var title = “”;
var matches = val.match(/title='([^\']+)'/g);
if (matches && matches.hasOwnProperty(length)) {
for (var ii = 0; ii < matches.length; ii++) {
title += matches[ii].substr(7, matches[ii].length-8) + "\n";
}
}
if (title == "") {
title = val.replace(/<br.*>/gi, "\n").replace(/<\/tr>/gi, "\n").replace(/<(?:.|\n)*?>/gm, '');
}
this.setCValue(val);
this.setAttribute("tooltitle", title);
};
this.getTitle = function() {
var tt = this.getAttribute("tooltitle");
if (!tt || (tt == "")) {
tt = this.getValue();
}
// console.log("getTitle: " + tt);
return tt;
};
}
eXcell_html.prototype = new eXcell; // nest all other methods from base class