admin管理员组

文章数量:1334133

I'm making an flight search app with Sencha Touch and have encountered a small problem.

I want to create a textfield for all the airports and need autoplete functionality for in order to make it easy for the user to choose departure airport and return airport. How can i implement this? The airports will be loaded via XML-schema and I can't seem to find any good documentation for this feature.

Thanx in advance!

I'm making an flight search app with Sencha Touch and have encountered a small problem.

I want to create a textfield for all the airports and need autoplete functionality for in order to make it easy for the user to choose departure airport and return airport. How can i implement this? The airports will be loaded via XML-schema and I can't seem to find any good documentation for this feature.

Thanx in advance!

Share Improve this question asked Jul 12, 2011 at 9:33 IsmailpIsmailp 2,3834 gold badges38 silver badges67 bronze badges 2
  • Okey, I didn't find any good way to run the autoplete. I made the textfield show a searchable list where the user could pick airports! – Ismailp Commented Jul 17, 2011 at 19:19
  • Ext also has a "bobox" functionality which could work as an autoplete. I haven't looked at it though! – Ismailp Commented Jul 18, 2011 at 7:41
Add a ment  | 

2 Answers 2

Reset to default 5

Since there were no custom ponents out there and I needed something like this myself as well, I smashed it together.

So, here it is. Sencha Touch 2 Autoplete Textfield ponent: https://github./martintajur/sencha-touch-2-autoplete-textfield

It currently uses AJAX request response for populating the autoplete matches. It also supports custom input by the user.

When serializing the form data, the value of this type of input will be:

  • the selected item ID in case user has selected a matched autoplete result
  • the typed text when the user has not chosen an autoplete result

It is very basic at the moment and pletely driven by own need for such a control. Feel free to fork, modify, adapt. It's MIT-licenced.

I think you should use a searchfield instead of textfield as suggested by @Ismailp,

Then you should create a popup(a panel) in its keyup event, which should contain a list of Airports.

Go through the hidden folder list-search in the example folder in downloaded sencha framework.It shows how to search through a list.

本文标签: javascriptAutocomplete for textfield in Sencha TouchStack Overflow