在 extjs 3.4 中使用带有 beforequery 函数的过滤器时,我遇到了 IE6 的问题,这是我的代码。
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);
            }
        }
    });
注意:它在 ff 和 Chrome 中工作
1.我在 IE6 中查询为/^[undefined]/。
2.但在Chrome和FF查询= /^[a-zA-Z0-9-.,:+*()='&_]/
非常感谢任何帮助。
提前致谢,
拉吉