PDA

View Full Version : FormPanel from existing markup



dolittle
1 Jan 2010, 3:08 PM
Hi,

Is it possible to create a FormPanel or a BasicForm from existing html form markup?
In Django(python) you define a model and it automatically generates the form markup and handles validation for you.
I'm trying to use ext to transform this markup to an extjs form and use client side validation and ajax submit without creating the form manually and without changing the server side logic.
I might need to add css classes to form fields in the django template so ext can recognize them.


Thanks

Animal
2 Jan 2010, 12:46 AM
Why would you want to go this roundabout route of generating some HTML, and then writing some very complex Javascript which crawls all over it, and creates some Ext objects?

That is just all too difficult and complicated.

It's SO easy to just create a form, so just do that.

dolittle
2 Jan 2010, 1:03 PM
Why would you want to go this roundabout route of generating some HTML, and then writing some very complex Javascript which crawls all over it, and creates some Ext objects?

That is just all too difficult and complicated.

It's SO easy to just create a form, so just do that.

because of DRY. In django you create a model and gets a form with validation for free.
No room for mistakes. You change your model and the form reflects this change.
If I can get ext to automatically understand the django forms I get client validation as well.

Condor
2 Jan 2010, 1:21 PM
You convert fields by creating an Ext field with an applyTo, el or transform config option.
These fields can either be added to a BasicForm or moved to a FormPanel.