View Full Version : filtering result list of a combobox

23 May 2011, 7:40 AM
I am quite new to ExtJS and have been searching a while, but did not find the answer to my problem.
I want to do a quite simple thing:
I have a combobox and want to filter the results list when entering characters. The results are already filtered, but only if the value starts with the typed characters. And i want to filter if the value contains the typed characters on any place.
I tried something like:

mycombo.on("keyup", function(th,ev) {
th.doquery(mycombo.getRawValue(), true);
But this is not working. Has anyone an idea or a link that would help?

Thanks in advance

23 May 2011, 10:48 PM
ok perhaps my description was not exactly enough. Here is the complete Combobox definition:

// Custom rendering Template
var resultTpl = new Ext.XTemplate(
'<tpl for="."><div class="x-combo-list-item">',

this.mailFromComboBox = new Ext.form.ComboBox({
store: App.stores.mailFromStore,
displayField: 'fullname',
valueField: 'displayname',
typeAhead: false,
mode: 'local',
tpl: resultTpl,
fieldLabel: i18n('from'),
triggerAction: 'all',
emptyText: i18n('empty'),
selectOnFocus: true,
anchor: '95%',
editable: true,
autoSelect: true,
forceSelection: true,
loadingText: i18n('search') + '...'

me.mailFromComboBox.on("select", function(combo,record,index) {

me.mailFromComboBox.on("keyup", function(th,ev) {
th.doquery(me.mailFromComboBox.getRawValue(), false);
and the store looks like this:

App.stores.mailFromStore = new Ext.data.JsonStore({
url: svc("getMailFrom"),
baseParams: {
sid: App.sid
autoLoad: true,
totalProperty: "totalcount",
id: "id",
root: "rows",
fields: [
name: "id"
name: "fullname",
return unescape(v);
name: "displayname"
name: "name"

callback: function() {
//own user is always the second entry!!!
var r = App.stores.mailFromStore.find("id", 1);
var reco = App.stores.mailFromStore.getAt(r);