PDA

View Full Version : combobox problem



madkris
15 Jul 2009, 12:05 AM
EDIT:
Hi all, Im having a little problem with my dropdown box.I somehow cannot get it to behave the way I want it to. Hoping someone could enlighten me.

this is my store..


var gender = new Ext.data.Store({
url : 'dummy/listGender',
reader : new Ext.data.JsonReader({
id : 'id'
},
['id','gender']
),
autoLoad : true
});
this piece of code is my combo box


xtype: 'combo',
fieldLabel: 'Gender',
name: 'gender',
mode: 'local',
emptyText: 'Choose a gender',
store: gender,
displayField: 'gender',
editable: false,
forceSelection : true,
I found this earlier just couldnt get it to work, if I understood correctly, it is the same thing I wanted to do which is for my combobox to load from store every time it is expanded.



xtype: 'combo',
fieldLabel: 'Gender',
name: 'gender',
mode: 'local',
emptyText: 'Choose a gender',
store: gender,
displayField: 'gender',
editable: false,
forceSelection : true,
listeners : {
beforequery: function(qe){
delete qe.combo.lastQuery;
}
}
any idea what im missing here?

thanks in advance,
-kris

- SOLVED - yay! :D