Results 1 to 3 of 3

Thread: How to handle a Ext.Img onClick event?

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    4

    Question Answered: How to handle a Ext.Img onClick event?

    Please, I need to handle a Ext.Img onClick event. Is there a way to do it since the Img component doesn't have this event?

    Thanks!

  2. You need to add the listener to the underlying element. Click and contextmenu events aren't exposed on components unless they add value to the event fired by the element.

    Code:
    listeners: {
        el: {
            click: function() {
                ...
            }
        }
    }
    or:

    Code:
    img.getEl().on('click', function() {
        ...
    });

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    You need to add the listener to the underlying element. Click and contextmenu events aren't exposed on components unless they add value to the event fired by the element.

    Code:
    listeners: {
        el: {
            click: function() {
                ...
            }
        }
    }
    or:

    Code:
    img.getEl().on('click', function() {
        ...
    });

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    4

    Wink Thanks!

    Thank you very much! It worked!

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
  •