PDA

View Full Version : [CLOSED] Set columnīs hideable property using JavaScript



RCN
Sep 13, 2012, 7:56 PM

Daniil
Sep 13, 2012, 8:53 PM
Hi,

Changing the hideable on the fly doesn't cause updating the menu.

I can suggest the following solution.

var grid = App.GridPanel1,
col = grid.columns[1];

col.hide();
col.hideable = false;
grid.headerCt.menu.destroy();
delete grid.headerCt.menu;

It causes the menu to be updated.

RCN
Sep 14, 2012, 11:26 AM
Thumbs up to you Danill, please mark it as closed.

RCN
Aug 01, 2013, 7:55 PM
Hi,

Changing the hideable on the fly doesn't cause updating the menu.

I can suggest the following solution.

var grid = App.GridPanel1,
col = grid.columns[1];

col.hide();
col.hideable = false;
grid.headerCt.menu.destroy();
delete grid.headerCt.menu;

It causes the menu to be updated.

After updating from SVN, i noticed that it's not necessary to do the following anymore:


grid.headerCt.menu.destroy();
delete grid.headerCt.menu;


So, we just have to hide the column and set hideable property to false, as shown below:


var hideNameColumn = function () {
var grid = App.GridPanel1,
col = grid.columns[1];

col.hide();
col.hideable = false;
}

Daniil
Aug 02, 2013, 4:05 AM
Good to know. Thank you for the update, Raphael.

RCN
Aug 02, 2013, 11:38 AM
You're welcome.