PDA

View Full Version : AutoComplete of ComboBox



poojagarg89
20 May 2012, 9:57 PM
Hi,
I want to make my combo box autocomplete i.e. when I start typing any letter it should show me all the values starting from that particular letter........but here when I write any letter it shows me full list including all values I want it to filter by query like select * from DS where code='a%'



var user_management_new_role=new Ext.data.Store({
//modal: 'User_Management',
proxy: new Ext.data.HttpProxy({
url:'UserManagement_NewRole',
method:'POST'}),
reader: new Ext.data.XmlReader({
record: 'items'
},['code'])
});

{
xtype:'combo',
fieldLabel:"<font color='red'> * </font>Role",
id:'role',
name:'role',
store: user_management_new_role ,
width:130,
allowBlank: false,
msgTarget:'under',
queryMode: 'local',
triggerAction:'all',
displayField:"code",
valueField:"code",
queryParam: 'code',
minChars:0,
emptyText:"Select Text..."
}


Here is the screen shot :
35442

Help me how to get this thing

Thanks n Regards,
Pooja

sword-it
20 May 2012, 10:32 PM
Use typeAhead:true for your combo, i.e.




{
xtype:'combo',
id:'role',
name:'role',
typeAhead:true,
store: user_management_new_role ,
width:130,
allowBlank: false
// ...
// ..
}


You will get the list starts from what you have typed in your combo.

For more specifications, check this :- http://docs.sencha.com/ext-js/3-4/#!/api/Ext.form.ComboBox-cfg-typeAhead

poojagarg89
20 May 2012, 10:46 PM
its not working with typeAhead: true, I tried it already......
When I use this it gives me 1st value in the combobox and if I type also then too it gives me first value in combo box.....

any other thing that I can use ??

sword-it
21 May 2012, 1:49 AM
Try setting mode: 'remote' for the combobox.

Regards.