/*
Product Name: dhtmlxSuite
Version: 5.2.0
Edition: Professional
License: content of this file is covered by DHTMLX Commercial or Enterprise license. Usage without proper license is prohibited. To obtain it contact sales@dhtmlx.com
Copyright UAB Dinamenta http://www.dhtmlx.com
*/
/**
* @desc: enable pop up menu which allows hidding/showing columns
* @edition: Professional
* @type: public
*/
dhtmlXGridObject.prototype.enableHeaderMenu=function(columns)
{
if (!window.dhtmlXMenuObject)
return dhtmlx.message("You need to include DHTMLX Menu");
if (!this._header_menu){
var menu = this._header_menu = new dhtmlXMenuObject();
menu.renderAsContextMenu();
var that=this;
menu.attachEvent("onBeforeContextMenu", function(){
that._showHContext(columns);
return true;
});
menu.attachEvent("onClick", function(id){
var checked = this.getCheckboxState(id);
var row = that.hdr.rows[1];
for (var j=0; j]*>/gi,"");
var visible = !(this.isColumnHidden(true_ind) || (this.getColWidth(true_ind)==0));
this._header_menu.addCheckbox("child", this._header_menu.topId, j, true_ind, val, visible);
j++;
}
true_ind+=(c.colSpan||1);
}
}
//(c)dhtmlx ltd. www.dhtmlx.com