PDA

View Full Version : [FIXED-405][3.??] this.id.indexOf is not a function



Hemlock
5 Jan 2010, 2:14 PM
I did a bit of searching and I can't see that this has been reported before. I think it was introduced in 3.0.3.

This block from ColumnModel is a problem (starts on line 222):


// if no id, create one using column's ordinal position
if(typeof c.id == 'undefined'){
c.id = i;
}


It adds numeric ids. The problem comes in when state.Manager is used and the component tries to call getStateId:


getStateId : function(){
return this.stateId || ((this.id.indexOf('ext-comp-') == 0 || this.id.indexOf('ext-gen') == 0) ? null : this.id);
},


Numbers don't have indexOf so those ids generated above will cause an error.

hendricd
5 Jan 2010, 8:11 PM
@Hemlock-

Give this override a try, but should be in SVN shortly:



Ext.override( Ext.Component, {
getStateId : function(){
return this.stateId || ((/^(ext-comp-|ext-gen)/).test(String(this.id)) ? null : this.id);
}
});

Jamie Avins
18 Jan 2010, 12:27 PM
Fixed in svn 5849