-
26 Jan 2013 12:55 PM #1
Unanswered: Add floating panel to viewport
Unanswered: Add floating panel to viewport
Hi,
I'm trying to add a floating panel to viewport (using insert()); I wish to have the panel "lose" it's floating behavior;
This worked with 2.0.1 and now it doesn't (2.1.0)
The other way around (fixed to floating) - does work;
Please advise,
-
28 Jan 2013 6:48 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
- Answers
- 3157
You need to make it non floating:
Code:var panel = new Ext.Panel({ centered : true, width : 200, height : 200, html : 'Test' }); Ext.Viewport.add({ items : [ { xtype : 'button', text : 'Insert', handler : function(button) { var cnt = button.up('container'); panel.setCentered(false); cnt.add(panel); } } ] }); Ext.Viewport.add(panel); panel.show();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.
-
28 Jan 2013 10:01 AM #3
More like
var panel = new Ext.Panel({ width : 200, height : 200, html : 'Test'});
Ext.Viewport.add({ items : [ { xtype : 'button', text : 'Insert', handler : function(button) { panel.showBy(this);
}}, { xtype : 'button', text : 'Insert1', handler : function(button) {
Viewport.insert(0, panel); } } ]});
Please advise
-
31 Jan 2013 1:47 AM #4


Reply With Quote