Animal
04-19-2007, 07:26 AM
/**
* Performs an async form post, updating this element with the response. If the form has the attribute enctype="multipart/form-data", it assumes it's a file upload.
* Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning. See YUI docs for more info.
* @param {String/HTMLElement} form The form Id or form element
* @param {String} url (optional) The url to pass the form to. If omitted the action attribute on the form will be used.
* @param {Boolean} reset (optional) Whether to try to reset the form after the update
* @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess, oResponse)
*/
formUpdate : function(form, url, reset, callback){ //<-- needs "params" parameter
if(this.fireEvent("beforeupdate", this.el, form, url) !== false){
formEl = Ext.getDom(form);
if(typeof url == "function"){
url = url.call(this);
}
if(typeof params == "function"){ //<-- not defined!
params = params();
}
url = url || formEl.action;
var cb = {
success: this.successDelegate,
failure: this.failureDelegate,
timeout: (this.timeout*1000),
argument: {"url": url, "form": formEl, "callback": callback, "reset": reset}
};
var isUpload = false;
var enctype = formEl.getAttribute("enctype");
if(enctype && enctype.toLowerCase() == "multipart/form-data"){
isUpload = true;
cb.upload = this.successDelegate;
}
this.transaction = Ext.lib.Ajax.formRequest(formEl, url, cb, null, isUpload, this.sslBlankUrl); // <-- "null" should be "params"
this.showLoading.defer(1, this);
}
},
* Performs an async form post, updating this element with the response. If the form has the attribute enctype="multipart/form-data", it assumes it's a file upload.
* Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning. See YUI docs for more info.
* @param {String/HTMLElement} form The form Id or form element
* @param {String} url (optional) The url to pass the form to. If omitted the action attribute on the form will be used.
* @param {Boolean} reset (optional) Whether to try to reset the form after the update
* @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess, oResponse)
*/
formUpdate : function(form, url, reset, callback){ //<-- needs "params" parameter
if(this.fireEvent("beforeupdate", this.el, form, url) !== false){
formEl = Ext.getDom(form);
if(typeof url == "function"){
url = url.call(this);
}
if(typeof params == "function"){ //<-- not defined!
params = params();
}
url = url || formEl.action;
var cb = {
success: this.successDelegate,
failure: this.failureDelegate,
timeout: (this.timeout*1000),
argument: {"url": url, "form": formEl, "callback": callback, "reset": reset}
};
var isUpload = false;
var enctype = formEl.getAttribute("enctype");
if(enctype && enctype.toLowerCase() == "multipart/form-data"){
isUpload = true;
cb.upload = this.successDelegate;
}
this.transaction = Ext.lib.Ajax.formRequest(formEl, url, cb, null, isUpload, this.sslBlankUrl); // <-- "null" should be "params"
this.showLoading.defer(1, this);
}
},