PDA

View Full Version : mouse out event for container not working properly.



chetan.nellekeri
4 Jun 2014, 11:15 AM
I want to perform some actions when ever the mouse moves out of the container. I used the mouseout event to handle this scenario. But the mouse is not working consistently. Some times it is not firing even the mouse is out of the container. Can you please suggest a way to implement the mouseout for a container which works consistently. Below is the sample code:
items: [{
xtype: 'container',
id: 'mailingAddressFormID',
height: 240
}],
listeners: {
mouseout: function ()
{
}
}]

Johnny Major
4 Jun 2014, 11:32 AM
I would suggest listening for the mouse out event off the element.

Example - also I would suggest using itemId instead of id.


Ext.create('Ext.container.Container',{
itemId : 'mailingAddressFormID',
margin : 10,
height : 240,
width : 240,
renderTo : Ext.getBody(),
style : {
'background-color' : '#777777'
},
listeners : {
afterrender : function(cmp){
cmp.el.on({
mouseout : function(){
console.log("you're out!");
}
});
}
}
});