-
20 Jan 2013 5:53 AM #1
Answered: Ext.form.Panel does not show in Ext.Panel
Answered: Ext.form.Panel does not show in Ext.Panel
Dear all,
I try the following code in Sencha Touch 2.1:
On button click, the Ext.Panel shows up, but completely empty and very small.Code:// A very simple container implementing a title bar with a button. On button click, a floating form panel should show up: Ext.application({ launch: function() { Ext.create('Ext.Container',{ fullscreen: true, items:[{ docked: 'top', xtype: 'titlebar', title: 'title', items: [{ xtype: 'button', text: 'open floating panel form', handler: function(btn) { var panel = Ext.create('Ext.Panel', { left: 0, top: 0, modal: true, layout: 'fit', hideOnMaskTap: true, items: [{ xtype: 'formpanel', items: [{ xtype: 'textfield', name: 'myfield', label: 'myfield', labelWidth: 120 }] }] }); panel.showBy(btn); } }] }, { html: 'test content' }] }); } });
If I try the same but without form panel, it works great, but does not help me as I then have no form:
So for me this seems to be a bug, or am I missing something?Code:Ext.application({ launch: function() { Ext.create('Ext.Container',{ fullscreen: true, items:[{ docked: 'top', xtype: 'titlebar', title: 'title', items: [{ xtype: 'button', text: 'open floating panel form', handler: function(btn) { var panel = Ext.create('Ext.Panel', { left: 0, top: 0, modal: true, hideOnMaskTap: true, items: [{ xtype: 'textfield', name: 'myfield', label: 'myfield', labelWidth: 120 }] }); panel.showBy(btn); } }] }, { html: 'test content' }] }); } });
-
Best Answer Posted by mitchellsimoens
The formpanel does not support auto sizing so since the floating Panel doesn't have any sizing it will look like it has no size. Give the panel a size and you will see the form.
-
22 Jan 2013 6:52 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
- Answers
- 3155
The formpanel does not support auto sizing so since the floating Panel doesn't have any sizing it will look like it has no size. Give the panel a size and you will see the form.
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.
-
22 Jan 2013 7:09 AM #3
thanks
thanks
Thanks, that was it. Giving the Ext.Panel a defined width / height did the trick.

