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
2 Answers
Reset to default 5Since 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
版权声明:本文标题:javascript - Autocomplete for textfield in Sencha Touch? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742279998a2445916.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论