PDA

View Full Version : getting this.config[col] has no properties on grid reconfigure



rojar
3 Feb 2008, 9:35 PM
I am creating a gridPanel and where grid displays store items.


gridPanel = new Ext.grid.GridPanel({
store: dataStore,
cm: columnModel,
......
});



Store items have variable attributes shown as a grid column. User has the option to see which column he wants to see.

when I am reconfiguring my grid sometimes I am getting the error



this.config[col] has no properties
getColumnWidth(-1)ext-all-debug.js (line 31561)
autoExpand(undefined)ext-all-debug.js (line 30135)
layout()ext-all-debug.js (line 29878)
refresh(true)ext-all-debug.js (line 30213)
reconfigure(Object data=[0] baseParams=Object paramNames=Object, Object config=[10] lookup=Object defaultWidth=100)ext-all-debug.js (line 29179)
createGrid(assets, Object method=POST form=configureColsForm)
createGridCallback(Object method=POST form=configureColsForm, true, Object tId=105 status=200 statusText=OK)
apply(function(), undefined, [Object method=POST form=configureColsForm, true, Object tId=105 status=200 statusText=OK], undefined)ext-base.js (line 9)
handleResponse(Object tId=105 status=200 statusText=OK)ext-all-debug.js (line 5207)
getViewWidth(Object conn=XMLHttpRequest tId=105, Object scope=Object argument=Object timeout=300000, undefined)ext-base.js (line 10)
getViewWidth()ext-base.js (line 10)
[Break on this error] return this.config[col].width || this.defaultWidth;

as shown in firebug.

When I debugged the code I found out that in ext-debug.js



getColumnWidth : function(col){
if(this.config[col] == undefined ){
alert("col ="+col);
alert("this.config[col] ="+this.config[col]);
}
return this.config[col].width || this.defaultWidth;
}


col value passed to function getColumnWidth(col) is -1 for some column.
getColumnWidth is called from following function because I have set

autoExpandColumn: columnModel.getColumnCount() - 1,


autoExpand : function(preventUpdate){
...
}


Can you plz suggest what could be the problem.

Thanks.:)

Condor
3 Feb 2008, 11:16 PM
autoExpandColumn should contain the id of the column, not the index of the column.