Results 1 to 2 of 2

Thread: Listening for the same event from multiple panels

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    6
    Answers
    2
    Vote Rating
    2
      0  

    Default Listening for the same event from multiple panels

    Hey Guys

    I'm creating multiple panels dynamically. I'd like to listen for click events from the panels.

    I'm creating objects like this:

    Code:
    var icon = {
    type: 'jobicon',
    jobLabel: iconLabel,
    jobImage: iconImage,                        
    width: iconWidth,
    height: iconHeight,
    listeners: {
     jobSelectedEvent: { fn: this.onJobIconClickEvent, scope: this } 
    }                       
    
    
    //icon.onIconTap = function(){console.log("BS Hack")};  //Oddly enough this actually works
    panel.add(icon);
    Inside my jobIcon I'm dispatching events like this:

    Code:
        onIconTap: function() {
            console.log("Dispatch event: " + this.scope);
            this.fireEvent("jobSelectedEvent", this);
        }

    The function is being called but my parent object doesn't receive it.
    Clearly I'm doing something wrong. Any help would be appreciated, thanks!

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    6
    Answers
    2
    Vote Rating
    2
      0  

    Default

    Sorry, figured it out.
    It was a scoping problem the event was being issued by an image inside of my panel

Posting Permissions

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