This is a migrated thread and some comments may be shown as answers.

Autocomplete using Suggest

2 Answers 229 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Kerry
Top achievements
Rank 1
Kerry asked on 22 Aug 2013, 09:09 PM
I would appreciate advice on how to use autocomplete with "suggest" to meet the following user requirements:
  • key in enough data to cause the desired selection to be suggested in the autocomplete text box and hit enter to navigate to the selection 
  • key in enough data to cause the desired selection to be suggested in the autocomplete text box and click a search buton to navigate to the selection
  • key in some data and pick one of the autocomplete selections from the list to navigate to the selection
  • key in data that does not autocomplete and hit enter causing a "not found" dialog to be displayed
  • key in data causing the drop down to display but then click somewhere else on the screen without any navigation happening
I have been working on this a while and am probably missing something simple.  I feel my implementation is too complicated and there should be a simpler way to achieve the requirements above.  My example below meets all of the requirements except the last one.  I can't find a way to solve the last one and still meet the other requirements.  In the example below, I pop an alert instead of navigating for demo purposes.  Because of this in a few of the cases it appears to navigate twice but in reality it would only navigate once. 

My example is in a jsbin at: 
http://jsbin.com/oToy/1/edit?html,output


2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 27 Aug 2013, 08:04 AM
Hello Kerry,

From the description and example it seems that the change event is not needed and is the reason why the last case does not work. Since all cases in which the navigation should be performed are enter, search and select I would suggest to remove the change event and handle the navigation in the click, keydown and select events. Here is a modified version of the jsBin that you provided.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kerry
Top achievements
Rank 1
answered on 27 Aug 2013, 10:33 PM
Thank you very much for the help Daniel.
Tags
AutoComplete
Asked by
Kerry
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Kerry
Top achievements
Rank 1
Share this question
or