PDA

View Full Version : Using Form.Layout in an existing form



vajra
18 Apr 2007, 7:11 PM
I am trying to use Form.Layout to render layouts containing columns, fieldsets, and fields to an existing form without creating a dynamic form. Since Form.Layout is part of the Ext.Form package, I think this would not be possible, but I thought I would give it a try ....

I have a form with 3 tabs on it and I would like to implement dynamic forms and attach them to an existing div without creating any additional form tags. This will allow me to use the power of creating a dynamic form, but still be able to submit the form as one form.

The form has many fields including many file upload controls...I don't want to have to serialize this into one form and then submit....Especially when there could be forms with 6 tabs each with 2 or 3 sub-tabs 8-|

Am I reading the docs correct that Form.Layout is only usable for dynamic forms or am I missing something?

Any help would be appreciated. The form class is so powerful.. Thank you ext Team!

Vajra

:D

jack.slocum
19 Apr 2007, 12:55 AM
Am I reading the docs correct that Form.Layout is only usable for dynamic forms or am I missing something?

That's correct. However, you could manually (or server side) generate the same markup that the form layout does and the CSS in form.css would lay it out just the same.

Does that help at all?

vajra
21 Apr 2007, 7:55 AM
Jack,

This does help and I am trying to implement such a solution now. But was wondering if there might be another way?

1. Is it possible for me to override the code and put in a DIV tag instead of a form tag?
2. Or is it possible to override and then pass a Div as the container to Layout?
3. Maybe I could use the DomHelper to replace the Form tags with Divs?

Just a few ideas I am going to try out, but I thought I would run them by you in the meantime.

Thanks

Vajra

vajra
22 Apr 2007, 5:27 PM
Well, after some messing around I found a solution ....

Create the dynamic form outside of the FORM you want to post. Then, after the dynamic form has been rendered, grab the child DOM tree and reattach it to a DIV inside your FORM.

That's about it ...Now on to test with file upload controls :D

Vajra