1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    3
    Vote Rating
    4
    dclaze is on a distinguished road

      0  

    Default Cancelling Buffered Event

    Cancelling Buffered Event


    Problem
    When developing a search widget we have the need to perform search either after the user stopped typing for a given time (buffer) or when the user presses an enter key.

    We listen to the keypress event which performs the search on enter
    AND
    We listen to the change event which performs the search after a configurable buffer

    We could simply ignore the enter key and let the buffered change event handle the search but we want a better User Experience.
    NOTE: We do not want to search if the character count is below a certain threshold, BUT we want the user to be allowed to force the search with the enter key.

    Proposed Solutions
    1. If the enter key is pressed cancel any buffered change events.
    2. Create a new buffered event called search, which both change and keypress events forward.

    Question
    Is there a better approach to multiple UI events triggering a single action?
    In the provided solution is there a way to add this code to Ext.util.Observable. I was not able to successfully add this behavior to Ext.util.Observable with an Override.

    Our Solution Here
    http://jsfiddle.net/dcolaizzo/NscJx/7/

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,789
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thanks for the solution. I have moved this to the user extensions and plugins forum instead of the Q&A
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi