PDA

View Full Version : 'id' is null or not an object (ext-all-debug.js)



ser
26 Oct 2010, 12:45 AM
I have an window and grid panel follow description items:



items: [
{
xtype: 'grid',
id: 'ChannelGrosery',
name: 'ChannelGrosery',
loadMask: true,
title: messages['activity.tab.channelGrocery'],
sm: new Ext.grid.RowSelectionModel({
singleSelect:true,
listeners: {
rowselect: function(smObj, rowIndex, record){
}
}
}),
viewConfig: {
forceFit:true
},
store: new Ext.data.JsonStore({
root: 'results',
storeId: 'ChannelGrosery',
proxy: new Ext.data.HttpProxy({
url: '/bat/activityDetailList',
method: 'GET'
}),
baseParams: {channel: 'ChannelGrosery', activityId: this.activityId},
fields: [ 'materialCategory', 'strataCalculation', 'channelRep', 'cluster', 'deadline', 'calculationStatus']
}),
columns: [
{header: messages['editactivity.grid.materialCategory'], dataIndex: 'materialCategory', sortable: true},
{header: messages['editactivity.grid.strataCalculation'], dataIndex: 'strataCalculation', width: 150, sortable: true},
{header: messages['editactivity.grid.channelRep'], dataIndex: 'channelRep', sortable: true},
{header: messages['editactivity.grid.cluster'], dataIndex: 'cluster', sortable: true},
{header: messages['editactivity.grid.deadLine'], dataIndex: 'deadline', sortable: true},
{header: messages['editactivity.grid.stateCalculation'], dataIndex: 'calculationStatus', sortable: true},
],
listeners: {
scope: this,
activate: this.handleActivate
}
}

If I comment out this code if the window is created.

When I create a window in IE6 I receive an error 'id' is null or not an object in ext-all-debug.js (45,546).



...
this.config = config;
this.lookup = {};

for(i = 0, len = config.length; i < len; i++){
c = Ext.applyIf(config[i], this.defaults);

if(Ext.isEmpty(c.id)){
c.id = i; //*************** 45546
}
if(!c.isColumn){
var Cls = Ext.grid.Column.types[c.xtype || 'gridcolumn'];
c = new Cls(c);
config[i] = c;
}
this.lookup[c.id] = c;
}
...


Why is this a problem only in IE6? In other browsers work well. And how to get rid of it?

Thanks.

ser
26 Oct 2010, 5:52 AM
unknown glitch?

Samuel.reed
16 Nov 2010, 1:09 PM
I just had the same problem. If you haven't fixed it already, here is the offending line:


{header: messages['editactivity.grid.stateCalculation'], dataIndex: 'calculationStatus', sortable: true},
],

IE is too dumb to disregard commas in lists when there is no proceeding element. In my case it was creating an array "config" with elements [0] and [1] but a length of "3", so when Ext iterated through it, a nullpointer was thrown as the array didn't have an element 2. If you remove this comma the problem is solved.

matt617
16 Nov 2010, 1:31 PM
you have an extra comma in your JSON object. highly recommend JSLint. will catch these kind of things in your source

ser
16 Nov 2010, 11:38 PM
Thanks. JSLint helped. The next time you'll be more attentive.

matt617
17 Nov 2010, 9:44 AM
i'll be more attentive?