Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto complete textfield with ExtJs

How can I code a simple auto complete feature with ExtJs? If the field has address and they start typing st it should become street, etc

like image 905
fastcodejava Avatar asked Nov 27 '22 22:11

fastcodejava


1 Answers

As Mitch suggests in his comment, you can use Ext.form.Combobox, properly configured, to do this. You won't need to bind anything to the keyup event, as Combobox will handle this for you.

Here's the beginning of a config that should work. You'll need to provide an appropariate Ext.data.Store (or subclass thereof), along with a few other config values (displayField,valueField,queryParam, etc). All the necessary stuff is pretty well documented in the API docs)

MyTypeahead = new Ext.form.ComboBox({
   triggerAction:'all',
   typeAhead:true,
   mode:'remote',
   minChars:2,
   forceSelection:true,
   hideTrigger:true
});
like image 62
timdev Avatar answered Dec 04 '22 08:12

timdev