-
19 Aug 2008 10:40 PM #1
this.config[col] is undefined
this.config[col] is undefined
Hello,
Can someone please tell me what's wrong with the code? I keep recieving
"this.config[col] is undefined
return this.config[col].width || this.defaultWidth;"
error when I create a NewUserForm object and place it in a container.
Code:Application.NewUserForm = Ext.extend(Ext.form.FormPanel, { initComponent: function() { var store = new Ext.data.SimpleStore({ fields: [ {name: 'userName'}, {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'} ] }); var checkColumn = new Ext.grid.CheckColumn({ header: "IsInRole?", dataIndex: 'isInRole', width: 55 }); var grid = new Ext.grid.GridPanel({ store: store, columns: [ {id:'userName',header: "User Name", width: 160, sortable: true, dataIndex: 'userName'}, {header: "", width: 85, sortable: true, dataIndex: 'lastChange'} ], stripeRows: true, autoExpandColumn: userName', height:350, width:600, title:'Select Roles' }); Ext.apply(this, { baseCls : 'x-plain', border : true, defaultType : 'textfield', items: [{ fieldLabel: 'Find a user', xtype : 'trigger', name : 'userName', width : '200', onTriggerClick: function() { Application.ShowUserSelection(); } }, grid] }); Application.NewUserForm.superclass.initComponent.call(this); } // initComponent }); Ext.reg('newuserform', Application.NewUserForm);
-
19 Aug 2008 11:17 PM #2
How about setting the width of your FormPanel to a number and not to a string .... ?
Guys
-
20 Aug 2008 12:54 AM #3
The form runs without problems when I remove the grid definition. So I think this is something about the grid, not the form itself...
Any ideas, I am stuck!
-
20 Aug 2008 1:20 AM #4
At a glance, I just found another syntax mistake when you wrote
in the grid definition, without any opening apostrophe to userName.Code:autoExpandColumn: userName',
if it's not this we'll look deeper...Guys
-
20 Aug 2008 2:11 AM #5
I removed the autoExpand attribute. Nothing's changed. Same error, and the grid is not rendered. I tried removing the column definitions but the error is not resolved. It's becase of the grid but I can't find why.
-
20 Aug 2008 5:07 PM #6
I have the same issue...
Maybe this will help:
I traced the code in ext-all-debug.js, line 31523/31524.
it returns -1 if it cannot find indexById. Something is going wrong with my xml vs. column headers. The problem occurs in the rendering of the grid when it tries to size everything.
I think it is related to a symbolic lookup of "name" vs. the integer index of "0".
--eric
-
21 Aug 2008 12:38 AM #7
I tried copying the grid from the example and running with the same configuration but the error is still there? Can it be something with my form creation routine?
-
21 Aug 2008 8:41 AM #8
possible solution + how to debug best?
possible solution + how to debug best?
Turns out my problem was in the definition of Ext.grid.ColumnModel. My autoexpand column which I selected in the definition of the grid was "name":
autoExpandColumn:"name",
this means that I needed a corresponding definition in the ColumnModel with an "ID". I thought the ID was referring to the XML record, but it's referring to an ID in the column Model:
{id: 'name', header: "Project Name", width:200, sortable:true, dataIndex:"name"}
if you don't have the ID it will fail to compare, return -1 for the call at ext-all-debug.js:31525
var ci = cm.getIndexById(g.autoExpandColumn);
is there a "slower" version of ext-all that checks return values for error conditions that I can "debug" with? Then I would switch to the optimized version once I have things running
-
15 Oct 2008 6:09 PM #9
I have comment the 'autoExpandColumn' and it works!
I have comment the 'autoExpandColumn' and it works!
I had the same issue, but after reading this thread, I have commented the 'autoExpandColumn' and works fine for me.
//autoExpandColumn: 'userName',
Thanks
-
15 Dec 2008 11:43 PM #10
hai,
try with the below code
{id:'name',header: "name",width: 75, sortable: true, dataIndex: 'name'},
.
.
.
autoExpandColumn:"name"
this will work
Thanks,
Rajapandian.


Reply With Quote