I have a grid with column1, column2, and column3.
I set enableHeaderMenu(“false,true,true”) so that column1 will be shown all the time.
I set enableColumnMove(true) so we can rearrange the columns.
When i move column1 over, so the grid now shows (column2, column1, column3). The header menu now allows me to hide column1, and column3. It seems like what ever is in the first position will be unhidable.
Modify dhtmlxgrid_hmenu.js
for (var i; i < this.hdr.rows[1].cells.length; i++) {
var c = this.hdr.rows[1].cells[i];
if (!this._hm_config || (this._hm_config[i] && this._hm_config[i] != “false”)) {
if (c.firstChild && c.firstChild.tagName == “DIV”) var val = c.firstChild.innerHTML;
else var val = c.innerHTML;
val = val.replace(/<[^>]*>/gi, “”);
a.push("
" + val + “
”);
}
true_ind += (c.colSpan || 1);
}
to
for (var i; i < this.hdr.rows[1].cells.length; i++) {
var c = this.hdr.rows[1].cells[i];
var j = i;
if (this._c_order) {
j = this._c_order[i];
}
if (!this._hm_config || (this._hm_config[j] && this._hm_config[j] != "false")) {
if (c.firstChild && c.firstChild.tagName == "DIV") var val = c.firstChild.innerHTML;
else var val = c.innerHTML;
val = val.replace(/<[^>]*>/gi, "");
a.push("<div class='dhx_header_cmenu_item'><input type='checkbox' column='" + true_ind + "' len='" + (c.colSpan || 1) + "' checked='true' />" + val + "</div>");
}
true_ind += (c.colSpan || 1);
}
so it takes into consideration of the column order.
Is there a better way of doing this?
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan