1
votes

I have a button and in my controller i created one mouse over event and a click event for that button's id. But everytime when i click button it goes to the mouseover event function only, but when I comment the mouseover it goes to the click event function nicely. Why this is so? I am using ext4.1

thanks in advance.

me.control({
                '#notificationIconId':{
                        click:me.notificationClick 
                  },

                '#notificationIconId':{
                        mouseover:me.notificationMouseOver 
                  }


    });
},

notificationMouseOver : function (){
    alert('1')
},

notificationClick :function(menuitem)
{

    alert('2')
}
1
There's a problem in your code. What's your code?rixo
hi rixo, code snippet is added there...thanks for ur quick replyA DEv

1 Answers

1
votes

You're using two times the same key '#notificationIconId' in a Javascript object... So, the last one is overriding previous ones.

You can add multiple listeners for the same selector:

'#notificationIconId': {
    click: me.notificationClick
    ,mouseover: me.notificationMouseOver 
}