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!