views:

2597

answers:

2

Hello. I've been trying to submit a form with the FormPanel using the Action class Ext defaults to. However, I'd like it to consider the response as a script, not JSON-encoded.

Has anyone had any experience on this?

+2  A: 

The best plan would be to create a custom action by extending Ext.form.Action.

You can then eval the response object or the result object in the success callback of your custom action.

Your custom action can be called from Ext.form.BasicForm in the usual way.

Dave Nolan
+1  A: 

using Form.getForm().submit() as your action response call works great and will automatically submit your form values to your backend as well as any custom values you would want to supply. On the return response you are passed a response object, which could be anything you want. So you could easily eval the return in the success handler.

There are also overrides to add this functionality into a normal Ext.ajax.request seen here http://extjs.com/forum/showthread.php?t=17691. There also exists Ext.data.ScriptTagProxy which does the same thing but for cross domain script tags.

Ballsacian1