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

      0  

    Default Unanswered: One handler for several events?

    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,496
    Answers
    13
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      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
    g2mac is on a distinguished road

      0  

    Default


    Ok, it's clear. Thanks!

Thread Participants: 1