Autocomplete using Suggest

3 posts, 1 answers
  1. Kerry
    Kerry avatar
    19 posts
    Member since:
    Jul 2013

    Posted 22 Aug 2013 Link to this post

    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. Answer
    Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 27 Aug 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Kerry
    Kerry avatar
    19 posts
    Member since:
    Jul 2013

    Posted 27 Aug 2013 Link to this post

    Thank you very much for the help Daniel.
Back to Top