How can I add Click Event to Ext.Img?
var paddleItem = new Ext.Img({
xtype : 'image',
src : "lib/Image/Paddle.png",
x : 200,
y : 300,
draggable : true,
index : 0,
id : 'paddleItem',
listeners : {
click : function(){
Ext.Msg.alert("Message");
}
},
renderTo : Ext.getBody()
});
This is My Code, but it didn't Work.
Please Get me some Advice..
Bind it on the underlying element:
var paddleItem = new Ext.Img({
src: "lib/Image/Paddle.png",
x: 200,
y: 300,
draggable: true,
index: 0,
id: 'paddleItem',
listeners: {
el: {
click: function() {
Ext.Msg.alert("Message");
}
}
},
renderTo: Ext.getBody()
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With