Results 1 to 3 of 3

Thread: Ext.Menu doesn't keep attached to the div which open it

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default Ext.Menu doesn't keep attached to the div which open it

    Hi,

    I have some issues with Ext.menu.

    I have a Menu, without any Ext button or other menu to open it.
    If i click on a div, i use showAt() with the position of my div then it displays the menu.

    The problem is that if i scroll in the page (not in the menu), the page will scroll behind but the menu will stay at its position. It won't follow the div it "belongs to".

    Is there any way that i can keep my menu attached to the div under which it is shown ??

    the code:
    Code:
    ...
    this.curMenu = new Ext.menu.Menu({
                floating: true,
                resultsView: dv,
                showSeparator: false,
                cls: 'no-icon-menu',
                items: its,
            });
    var menuElt = Ext.get(Ext.DomQuery.selectNode('div.'+type+'Menu', node));
    menuElt.on('click', function(){
       this.curMenu.showAt([menuElt.getX(), menuElt.getY() + menuElt.getHeight()]);
    }, this);
    Thanks

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    The reason is you are showing it at a certain XY not within the div. Not sure what would happen but you can try to renderTo to the div.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    A solution could be to replace the menu manually.
    But i can't find how to get the heigth that have been scrolled on a scroll event

    Code:
    this.ownerCt.ownerCt.body.on('scroll', function(e,t,o){
    		            		alert(e.getWheelDelta());
    		            	});
    always display 0

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •