Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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. There also exists Ext.data.ScriptTagProxy which does the same thing but for cross domain script tags.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top