-
23 Sep 2011 6:42 AM #1
Answered: how to set an absolute position for a floating panel?
Answered: how to set an absolute position for a floating panel?
Hi, I setted up a floating panel to acts like a modal.
I fixed its dimensions... well, now I want it to be horizontally centered but vertically attached to the bottom side of its container (the viewport).
I have tried to use "Ext.Panel.setPositions(X,Y)" but with no results...
Do you have an answer?Follow my blog at: MovableApp.com!
http://twitter.com/#!/movableapp - My Sencha Touch Learning Experience
-
Best Answer Posted by NickT
I have created an example panel, that after render, sets its position. Perhaps it is just a typo in your method invocation? i noticed you used setPositions instead of setPosition?
Code:{ height: 500, width: 500, xtype: 'panel', float: true, modal: true, items:[ {html: 'asd'} ], listeners:{ 'afterrender': function(panel){ panel.setPosition(100,300); } } }
-
24 Sep 2011 11:17 AM #2Sencha Premium Member
- Join Date
- May 2008
- Location
- Pasadena, California
- Posts
- 172
- Vote Rating
- 1
- Answers
- 27
I have created an example panel, that after render, sets its position. Perhaps it is just a typo in your method invocation? i noticed you used setPositions instead of setPosition?
Code:{ height: 500, width: 500, xtype: 'panel', float: true, modal: true, items:[ {html: 'asd'} ], listeners:{ 'afterrender': function(panel){ panel.setPosition(100,300); } } }
-
23 Aug 2012 6:19 PM #3
unable to set absolute position of popup
unable to set absolute position of popup
Hi,
I am trying to position my popup panel but above mentioned method does not seems to work for me. Please advice where i am going wrong
and the code to open the popupCode:Myapp.views.appEmpfehlenPopup = new Ext.Panel({ floating: true, centered: true, modal: true, width: '300px', height: '150px', border:0, styleHtmlContent: true, items:[ { xtype:'box', html:loadURL('app/views/facebookbutton.html') }, { html:loadURL('app/views/twitter.html') } ], listeners:{ 'afterrender': function(panel){ panel.setPosition(40,300); console.log("inside after render"); } }, dockedItems: [{ xtype: 'toolbar', cls:'welcometoolbar', title: 'Weitersagen über:', items: [] }] });
Code:{ xtype:'button', name : 'cashbackAppEmpfehlen', text : '', border:0, cls :'btncashbackappempfehlen', handler:function(btn){ Myapp.views.appEmpfehlenPopup.showBy(btn); } },
I am able to see the message "inside after render" so the function is called but property not applied.
-
12 Apr 2013 10:50 AM #4
For Sencha Touch 2.1.1 I found I had to:
- make a new CSS class: .my_modal_cssclass { position: absolute;}
- and then set cls property on the panel: cls: 'my_modal_cssclass';


Reply With Quote