PDA

View Full Version : [OPEN] [2.0b1] Ext.form.Fieldset problem within an Ext.Window



lee.mcmullen
24 Oct 2007, 1:40 AM
Hi guys,

Please see this thread which I created in the Help forum:

http://extjs.com/forum/showthread.php?t=16019

In summary I am trying do the following:


Open an Ext modal Window whose contents are populated from a form I have stored on the server using the "autoLoad" attribute. This works fine.
The returned HTML contains a fieldset. I am trying to apply the Ext style to this fieldset and also make it collapsible. I am doing this by calling the relevant code using the "callback" attribute associated with the "autoLoad" attribute.
The problem is that there appears to be some kind of bug with the way the fieldset is rendered. Have a look at the screenshot (http://extjs.com/forum/attachment.php?attachmentid=2273&stc=1&d=1193149679) to see what I mean.


All of the information (code and screenshot) is available in the above thread. Let me know if you want me to post it here too.

djliquidice said that he thought this may be a bug hence why I am posting it in this forum, however if it's not a bug but I am doing something incorrectly then please accept my apologies (and also some pointers on where I went wrong might be nice ;) !!)

Regards,
Lee McMullen.

jsakalos
28 Oct 2007, 8:30 PM
Hmm, I'm not quite sure what do you want to achieve. If you want forms that are Ext.Components and contain fields as items collections than this is not the way. What exactly applyTo does is:



applyTo : Mixed The id of the node, a DOM node or an existing Element corresponding to a DIV that is already present in the document ...
The id of the node, a DOM node or an existing Element corresponding to a DIV that is already present in the document that specifies some panel-specific structural markup. When applyTo is used, constituent parts of the panel can be specified by CSS class name within the main element, and the panel will automatically create those components from that markup. Any required components not specified in the markup will be autogenerated if necessary. The following class names are supported (baseCls will be replaced by baseCls (http://extjs.com/forum/../deploy/ext-2.0-beta1/docs/output/Ext.Panel.html#baseCls)):
baseCls + '-header'
baseCls + '-header-text'
baseCls + '-bwrap'
baseCls + '-tbar'
baseCls + '-body'
baseCls + '-bbar'
baseCls + '-footer'Using this config, a call to render() is not required. If applyTo is specified, any value passed for renderTo (http://extjs.com/forum/../deploy/ext-2.0-beta1/docs/output/Ext.Panel.html#renderTo) will be ignored and the target element's parent node will automatically be used as the panel's container.
If you want to know exactly how it works take a look at onRender method of Ext.Panel class.

If you want full featured Ext forms with validation, ajax load, submit you need to create them in the javascript code.

lee.mcmullen
29 Oct 2007, 2:02 AM
Thanks for your reply,


Hmm, I'm not quite sure what do you want to achieve.

What I am trying to achieve in this instance is the following:

I already have a form which contains all my HTML.
Within this HTML there are a some fieldsets.
I would like to apply the Ext fieldset functionality to one or all of these fieldsets.


I thought (read "hoped" !) that the "applyTo" config option of the Ext.form.FieldSet class would apply the Ext fieldset functionality (collapsible etc) to the fieldset whose id is passed.

If this isn't the case then what is the "applyTo" config option used for within the Ext.form.FieldSet class??

Thanks again,
Lee

jsakalos
29 Oct 2007, 1:47 PM
FieldSet is subclass of panel and it inherits this method from Panel. Doesn't add anything to it.

Your goal is achievable - it just need some more coding. You can write a routine that analyzes the markup, extracts fields (fieldsets, ...) from it and creates corresponding Ext.form.FormPanel with all children.

brian.moeskau
29 Oct 2007, 2:31 PM
I added an @hide to remove applyTo from the fieldSet API docs for now as it does not really apply as is.