PDA

View Full Version : Uncaught TypeError: Cannot call method 'format' of undefined



raj542
9 Apr 2012, 9:14 PM
Hi all,

I am using extjs version 3.4 and I am getting one error in this line:var query = new RegExp(Ext.String.format('field1', e.query.replace(/\?/g, '[A-Za-z0-9]')));
like--"Uncaught TypeError: Cannot call method 'format' of undefined"I added listener like this please let me know if there is any wrong in this.
this.findById('field1').addListener({
beforequery: function (e) {
if (e.query && e.query.indexOf('?') != -1) {
e.cancel = true;
var query = new RegExp(Ext.String.format('field1', e.query.replace(/\?/g, '[A-Za-z0-9]')));
this.expand();
this.store.clearFilter(true);
this.store.filter(this.displayField, query);
}
}
});Thanks in advance,
Raj

chramer
9 Apr 2012, 9:45 PM
try


String.format(..)

there is no such thing as 'Ext.String' in Ext.3.4!

raj542
9 Apr 2012, 10:06 PM
Hi chramer (http://www.sencha.com/forum/member.php?240566-chramer) its working fine buy using
String.format(..)
Thanks for the help