PDA

View Full Version : Submit HTML Form Using ExtJS



pawan.v.jadhav
30 Jun 2008, 5:32 AM
Hi,
I just started using extJS in my project.
Can anyone tell me how to submit existing form using ExtJS.
I am using Panel and Layout so submit should be AJAX not a normal submit.

e.g. my form is like.
<FORM action="controller" method="post">


<input type="text" name="textName">
<INPUT type="checkbox" name="chkCategory">
<INPUT type="checkbox" name="chkCategory">
<INPUT type="checkbox" name="chkCategory">
<INPUT type="checkbox" name="chkCategory">
</FORM>

I want to submit this form using ExtJS Action Load and Submit is this possible? on server side i should get textName and chkCategory value.

Is it possible to add existing html fields into ExtJS FormPanel

Regards,
Pawan

Animal
30 Jun 2008, 5:39 AM
You will have to create the Ext.form.Fields from the existing input fields usnig the applyTo config.

Then create a BasicForm from your existing form element, add the Fields to it, and off you go.

(really though, you should not be using any HTML at all, your document body should be totaly empty)

pawan.v.jadhav
30 Jun 2008, 5:42 AM
i.e. we can add existing html element into form using applyTo...is it?

Animal
30 Jun 2008, 5:49 AM
Yes, applyTo "converts" an existing input field into an Ext.form.Field.

You can then add them to the Ext.form.BasicForm that you create from your existing <form> element.

VishalKulkarni
30 Jun 2008, 6:00 AM
Can u please give an example...

pawan.v.jadhav
30 Jun 2008, 8:20 PM
what about the performance of ExtJS using AJAX form submit?
if i have tree with thousands of node and checkBoxes in FormPanel and i want selected checkBoxes on server side.


I am trying to use Layouts in My project.
How standard submit will help me to load /submit/ unload Panels (same as target in frameset)..

Animal
30 Jun 2008, 11:57 PM
thousands??? Really? Thousands? How can that be good UI design?

pawan.v.jadhav
1 Jul 2008, 12:16 AM
Tree with checkBoxes can have that much leaf+parent category

Animal
1 Jul 2008, 12:27 AM
OK, if you use an Ext.tree.TreePanel which does lazy loading, and lazy rendering it should be alright because a user will surely never expand all 10,000 nodes, so submitting it shouldn't be too bad.

pawan.v.jadhav
1 Jul 2008, 12:43 AM
OK... Is there any way to use standard submit if i am using Panels and Layout...like from this panel i am submitting one form and updating different panel using forward..

i think we can not...

Animal
1 Jul 2008, 1:21 AM
So let's get this straight. You have a TreePanel with checkboxes, and you want to submit it?