-
22 Oct 2012 8:48 AM #1
Ext.Menu doesn't keep attached to the div which open it
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:
ThanksCode:... 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);
-
25 Oct 2012 6:43 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
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 @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
30 Oct 2012 7:19 AM #3
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
always display 0Code:this.ownerCt.ownerCt.body.on('scroll', function(e,t,o){ alert(e.getWheelDelta()); });


Reply With Quote