Extjs Form Action Submit - Custom override?
Looking at the source code of Action.Submit, I'm trying to figure out wher开发者_运维技巧e ext is appending the form's fields to the parameters.
Instead of sending each field as a separate parameter, I want to send something like:
formObj:{field1:value, field2:value}
Currently, each of those values are simply added to the parameter list along with any custom/baseParams.
Where are these formfields being added so that I can change this behaviour?
Thanks.
I'm not sure what your override needs to look like, but you'll probably want to look at Ext.Ajax.request()
(in Core / Connection.js). When posting a form, the fields get serialized there, in this code block:
if(form = Ext.getDom(o.form)){
url = url || form.action;
serForm = Ext.lib.Ajax.serializeForm(form);
p = p ? (p + '&' + serForm) : serForm;
}
If you really want to track the process of creating parameter list, you can refer to Ext.form.Action.getParams
.
You should also consider Ext.form.BasicForm.getValues
as it returns exactly the result you want, the only problem is that you'll need to send it manually, e.g. using Ext.Ajax.request
.
精彩评论