View Full Version : [3.3.1]Ext.grid.ColumnModel -> setHidden

3 Feb 2011, 3:11 AM
hi team,

at the moment, the method is:

setHidden : function(colIndex, hidden) {
var c = this.config[colIndex];
if(c.hidden !== hidden){
c.hidden = hidden;
this.totalWidth = null;
this.fireEvent("hiddenchange", this, colIndex, hidden);

which works fine, but is not robust.

if you search for a column that does not exist, you get -1 for the index.
then call this method and it will try to set undefined.hidden.

a check like

if (parseInt(colIndex) < 0)return;


var c = this.config[colIndex];
if (!c)return;

would be helpful.

best regards