1. #1
    Sencha User
    Join Date
    Aug 2012
    Location
    Pune, India
    Posts
    78
    Vote Rating
    0
    Answers
    5
    Pravin.Pawar is on a distinguished road

      0  

    Default Answered: Showing popup menu on onmouseover

    Answered: Showing popup menu on onmouseover


    Hi,

    I have to populate ExtJS menu on onmouseover of div control. Please let me know how can if you have any idea.

    Regards, Pravin

  2. Add listener to div mouseenter event.
    html:
    Code:
    ​<div id="test">Test</div>​​​​​​​​​​​​​​​​​​​​​​​​​​​
    js:
    Code:
    Ext.onReady(function() {
        var menu = Ext.create('Ext.menu.Menu', {
            floating: true,
            items: [{
                text: 'regular item 1'},
            {
                text: 'regular item 2'},
            {
                text: 'regular item 3'}]
        });
    
        var div = Ext.get('test');
        div.on('mouseenter', function(e) {
            menu.showAt(e.getXY());
        });
        console.log(div);
    });​
    live: http://jsfiddle.net/6mS9G/1/

  3. #2
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    250
    Vote Rating
    42
    Answers
    44
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    Add listener to div mouseenter event.
    html:
    Code:
    ​<div id="test">Test</div>​​​​​​​​​​​​​​​​​​​​​​​​​​​
    js:
    Code:
    Ext.onReady(function() {
        var menu = Ext.create('Ext.menu.Menu', {
            floating: true,
            items: [{
                text: 'regular item 1'},
            {
                text: 'regular item 2'},
            {
                text: 'regular item 3'}]
        });
    
        var div = Ext.get('test');
        div.on('mouseenter', function(e) {
            menu.showAt(e.getXY());
        });
        console.log(div);
    });​
    live: http://jsfiddle.net/6mS9G/1/

  4. #3
    Sencha User
    Join Date
    Aug 2012
    Location
    Pune, India
    Posts
    78
    Vote Rating
    0
    Answers
    5
    Pravin.Pawar is on a distinguished road

      0  

    Default


    Thanks... nice solution.

    Pravin

Thread Participants: 1