Results 1 to 3 of 3

Thread: One handler for several events?

  1. #1
    Sencha User g2mac's Avatar
    Join Date
    Jun 2009
    Location
    Odessa, Ukraine
    Posts
    69
    Vote Rating
    0
      0  

    Default Unanswered: One handler for several events?

    Hallo!

    Is there a short version for:
    Code:
    el.on({
        'click': handler,
        'keydown': handler,
        'someevent': handler
    })
    ?
    For example:
    Code:
    el.on('click keydown someevent',handler)

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Answers
    15
    Vote Rating
    59
      0  

    Default

    addListener does not go to the computational expense of splitting the event string on spaces, and iterating over the results.

    You could add a wrapper to do this if you thought it worthwhile.

    I'm not sure there is a large enough use case to justify it.

  3. #3
    Sencha User g2mac's Avatar
    Join Date
    Jun 2009
    Location
    Odessa, Ukraine
    Posts
    69
    Vote Rating
    0
      0  

    Default

    Ok, it's clear. Thanks!

Posting Permissions

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