Results 1 to 2 of 2

Thread: Combobox events specialkey / select

  1. #1
    Sencha User
    Join Date
    May 2014
    Posts
    2

    Default Combobox events specialkey / select

    Hello,

    I have a combobox, on which i set the following listeners :
    - specialkey
    - select
    I'm actually trying to perform a specific action when i write some value in my combobox and press ENTER, and another specific action when i choose one of the items listed in the boundlist.

    I've put a testcase here : https://fiddle.sencha.com/#fiddle/7bv

    When i write something in the combo and press ENTER, i get correctly the event specialkey.
    When i write something in the combo to filter the boundlist and clic on an item, i get correctly the event select.
    But, when i navigate through the boundlist with arrow keys, and press enter on an item to select it, i got both events fired.

    Is there a way to have only the select event fired when i select an item with arrow keys and enter key ?

  2. #2
    Sencha User
    Join Date
    May 2014
    Posts
    2

    Default dirty workaround

    Ok, so i found a dirty workaround i can live with temporarely, thanks to those links :
    - http://www.sencha.com/forum/showthread.php?271118
    - http://stackoverflow.com/questions/1...-its-arguments

    Quick explanation : i delay my specialkey listener by few ms so it arrives after the select event. I make sure to suspend events before calling the delayed handler and resume them at end of the handler. In my specialkey handler, i check if selection is empty to determine if i have pressed enter in the field or on an item. I still have to keep my select handler to catch select events by clic.

    Applied to my testcase, it gives this result : https://fiddle.sencha.com/#fiddle/7ck

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •