-
2 Nov 2011 7:30 PM #1
Answered: Nesting FormPanel in Modal Window
Answered: Nesting FormPanel in Modal Window
What is the best way about going about nesting a Ext.form.Panel in a modal popup
Doesn't show the fields, renders the window with toolbar. If I make the xtype to be fieldset it draws the textfield. If I nest a fieldset xtype with the textfield in it, also doesn't work.Code:var popup = Ext.create('Ext.Panel', { floating : true, modal : true, centered : true, width : 300, height : 400, items : [{ docked : 'top', xtype : 'toolbar', title : 'Add Borrower' }, { xtype : 'formpanel', items : [{ xtype : 'textfield', name : 'hello', label : 'hello' }] }], scrollable : true }); popup.show()
-
Best Answer Posted by AndreaCammarata
Hi Stan.
You just need to set your panel layout as 'fit'.
Please even notice that the "floating" config has been deprecated, so you only need to set the "centered" config as true.
Hope this helps.Code:var popup = Ext.create('Ext.Panel', { modal : true, centered : true, width : 300, height : 400, layout: 'fit', items : [{ docked : 'top', xtype : 'toolbar', title : 'Add Borrower' }, { xtype : 'formpanel', items : [{ xtype : 'textfield', name : 'hello', label : 'hello' }] }], scrollable : true }); popup.show()
-
3 Nov 2011 1:54 AM #2
Hi Stan.
You just need to set your panel layout as 'fit'.
Please even notice that the "floating" config has been deprecated, so you only need to set the "centered" config as true.
Hope this helps.Code:var popup = Ext.create('Ext.Panel', { modal : true, centered : true, width : 300, height : 400, layout: 'fit', items : [{ docked : 'top', xtype : 'toolbar', title : 'Add Borrower' }, { xtype : 'formpanel', items : [{ xtype : 'textfield', name : 'hello', label : 'hello' }] }], scrollable : true }); popup.show()Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
3 Nov 2011 6:57 PM #3
That works, thanks!
I'm having an issue with the hideOnMaskTap (default: true) though. I'm not sure if it's a bug or not. Whenever I click anywhere, even in the Panel it hides.
See video:
-
4 Nov 2011 2:17 AM #4
You are welcome.
About your question, the "hideOnMaskTap" config should close the popup only when you tap the mask element outside the panel.
That's a strange behaviour.
Do you even have some other functions in your code that close this overlay panel?Sencha Inc
Andrea Cammarata, Solutions Engineer
CEO at SIMACS
@AndreaCammarata
www.andreacammarata.com
github: https://github.com/AndreaCammarata
-
4 Nov 2011 7:21 AM #5
Nope. Fortunately, I don't need hideOnMaskTap for that component. I will try to make a simplified test case. If I still see the issue I'll post a bug report.
Edit: Still there with test case, will post bug report.


Reply With Quote