the setText of accordion function does not check for an icon being first element, the following fixes it but is probably not bullet proof:
this.conf.text = text;
if (this.cell.childNodes[this.conf.idx.hdr].firstChild.className != “dhx_cell_hdr_icon”) {
this.cell.childNodes[this.conf.idx.hdr].firstChild.innerHTML = “” + text + “”;
} else {
this.cell.childNodes[this.conf.idx.hdr].childNodes[1].innerHTML = “” + text + “”;
}
Darya
#2
Thank you for sharing this info.
We will consider this situation
But you still can set item text on init as in a sample:
dhtmlx.com/docs/products/dhtmlxA … icons.html
Andrei
#3
dhtmlXAccordionCell.prototype.setText = function(text) {
this.conf.text = text;
var t = this.cell.childNodes[this.conf.idx.hdr];
t.childNodes[(t.firstChild.className=="dhx_cell_hdr_icon"?1:0)].innerHTML = "<span>"+text+"</span>";
t = null;
};
I would like for this to be fixed in future versions as well. I am using font awesome, so I did a simple tweak to the solution above…
dhtmlXAccordionCell.prototype.setText = function (text) {
this.conf.text = text;
var t = this.cell.childNodes[this.conf.idx.hdr];
t.childNodes[(t.firstChild.className.substring(0, 6) == "fa fa-" ? 1 : 0)].innerHTML = "<span>" + text + "</span>";
t = null;
};