1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    22
    Vote Rating
    0
    lee el is on a distinguished road

      0  

    Default Answered: Mouseover event on a panel

    Hi,

    I am trying to capture a mouseover event on a panel.
    my panel has an image on one side and a label on the other side (Hbox layout).
    my code is as follows:
    ....
    Code:
    items: [                            {
                                    xtype: 'image',
                                    src: 'resources/ext/resources/css/images/mostActivePanel/ma_lines.png'
                                },
                                {
                                    xtype: 'label',
                                    forId: 'myFieldId',
                                    text: 'Lines',
                                    margin: '0 0 0 10'
                                }
                                ],
                                 listeners: {
                                     element: 'body',
                                    mouseover:function(e,t,eOpt) {
                                                console.log('mouseover was called'); 
                                                      }
    The problem I see is when the mouse is moving over the panel the mouse over method is called but when I continue to move on the panel itself to the image I get another call to the method.(same for label).

    what I am trying to achieve is that the method will be called only once when the mouse is over the panel no matter where and to avoid getting multiple calls to the method when the mouse moves on items of the panel

    thanks for your help,
    Lee

  2. I think you may be looking for mouseenter rather than mouseover.

  3. #2
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,334
    Vote Rating
    87
    Answers
    124
    sword-it is just really nice sword-it is just really nice sword-it is just really nice sword-it is just really nice

      0  
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  4. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,786
    Vote Rating
    379
    Answers
    581
    skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute skirtle has a reputation beyond repute

      0  

    Default

    I think you may be looking for mouseenter rather than mouseover.

  5. #4
    Sencha User
    Join Date
    Dec 2012
    Posts
    22
    Vote Rating
    0
    lee el is on a distinguished road

      0  

    Default Changing to mouseenter solved the problem

    Hi,

    Changing to mouseover to mouseenter solved the problem!

    thanks for the help,
    Lee

Thread Participants: 2