Extjs : AutoComplete Textfield
In this section i want to share about how to make textfield in extjs with autocomplete. I think this tutorial very simple but i hope this tutorial can be useful for newbie like me. You can create textfield with autocomplete from combo box. If you can use combo box, i think it’s very easy to create textfield with auto suggest. Below is part of code to make combo box.
var combo = new Ext.form.ComboBox({
store: store,
displayField:'state',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
hideTrigger: true,//hide combobox trigger, so the combobox looks like textfield
width: 250,
renderTo: 'autocomplete'
});
You just add hideTrigger: true to get textfield with autocomplete. It’s just easy !
You can download source code here.
| incoming terms | |
|---|---|

October 2nd, 2010 at 6:17 am
wew