views:

1749

answers:

2

By default, a FormPanel in ExtJS 3.1.0 posts the form fields as application/x-www-form-urlencoded when you call its submit() function.

Is there any way to get it to post JSON instead?

+1  A: 

You probably want to extend Ext.form.Action.Submit to encode the params as JSON instead of url-encoding them in the body.

Jonathan Julian
Thanks for the reply, this is definitely the direction I want to go in, but I'm just starting off with ExtJS and I'd rather get the basics working first before I start extending stuff.
Daniel T.
Extending components is really easy to do: see the section "A Re-usable Template" in http://www.extjs.com/learn/Manual:Component:Extending_Ext_ComponentsLearn to extend now before you build too much crazy code!
Jonathan Julian
A: 

You can use getValues() to pull the values and then Ext.encode() them and manually do an Ext.Ajax.request({}) with this data as well.

Lloyd
Thanks, this is the same solution as the one given here: http://www.extjs.com/forum/showthread.php?p=433863#post433863
Daniel T.