PDA

View Full Version : beforequery with filter is not working in IE6



raj542
15 Apr 2012, 9:41 PM
Hi all,
I am facing an issue with IE6 while using filter with beforequery function, here is my code.



this.findById('field1').addListener({
beforequery: function(e) {
var metadataStep = Ext.getCmp('step2');
if (e.query && e.query.indexOf('?') != -1) {
var temp = '';
for(var i=0;i<e.query.length;i++){
temp = temp + '['+e.query[i]+ ']';
}
e.cancel = true;
var query = new RegExp(String.format('^{0}',temp.replace(/\?/g, 'a-zA-Z0-9\-\.,:\+\*\(\)=\'&_')));
if (combo.store.getCount() > 0 || combo.listEmptyText) {
combo.expand();
combo.restrictHeight();
}
this.store.clearFilter(true);
this.store.filter(this.displayField, query);
}
}
});


Note: Its working in ff and Chrome
1.I am getting query as/^[undefined]/ in IE6.
2.But in Chrome and FF query = /^[a-zA-Z0-9-.,:+\*\()='&_]/

Any help is highly appreciated.

Thanks in advance,
Raj

scottmartin
16 Apr 2012, 11:08 AM
Not to state the obvious, but have you tried to confirm you RE is compatible with IE6?
Also there are several topics available when searching for "regular expression IE6"

Several tools available:
http://www.ultrapico.com/Expresso.htm
http://www.regular-expressions.info/regexmagic.html

Regards,
Scott.