PDA

View Full Version : Generating BasicForm's from markup



_robby
15 May 2008, 1:00 PM
I have been trying to find a way to create a BasicForm from markup.

The online docs (via the api link though this (http://extjs.com/deploy/ext/docs/output/Ext.form.Form.html)document does list applyTo as an option) do not mention an applyTo option in the config. I tried this anyway and received an error saying that this.el has no properties.

I also tried passing the form Element object to the BasicForm constructor. This did not generate an error, and seemed to work, creating a BasicForm object who's el is the form node. After doing this, though, the submit button ceases to work, and The 'items' within the BasicForm is empty.

Am I going to have to manually add each of the form's inputs?

Ty for any help,
Robby

_robby
16 May 2008, 1:09 PM
I ended up writing a method to build the simple form object. It creates Field objects from the inputs and adds them to the basic form. It also searches for buttons w/in the form, and adds click listeners to handle submitting / resetting the form.

I have to believe though that their is an easier / more robust was of accomplishing this.