POST = 'POST',\r
GET = 'GET',\r
WINDOW = window;\r
- \r
+\r
<div id="cls-Ext.data.Connection"></div>/**\r
* @class Ext.data.Connection\r
* @extends Ext.util.Observable\r
* @constructor\r
* @param {Object} config a configuration object.\r
*/\r
- Ext.data.Connection = function(config){ \r
+ Ext.data.Connection = function(config){\r
Ext.apply(this, config);\r
this.addEvents(\r
<div id="event-Ext.data.Connection-beforerequest"></div>/**\r
* @type Boolean\r
*/\r
autoAbort:false,\r
- \r
+\r
<div id="cfg-Ext.data.Connection-disableCaching"></div>/**\r
* @cfg {Boolean} disableCaching (Optional) True to add a unique cache-buster param to GET requests. (defaults to true)\r
* @type Boolean\r
*/\r
disableCaching: true,\r
- \r
+\r
<div id="cfg-Ext.data.Connection-disableCachingParam"></div>/**\r
* @cfg {String} disableCachingParam (Optional) Change the parameter which is sent went disabling caching\r
* through a cache buster. Defaults to '_dc'\r
* @type String\r
*/\r
disableCachingParam: '_dc',\r
- \r
+\r
<div id="method-Ext.data.Connection-request"></div>/**\r
* <p>Sends an HTTP request to a remote server.</p>\r
* <p><b>Important:</b> Ajax server requests are asynchronous, and this call will\r
* parameters:<ul>\r
* <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>\r
* <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li>\r
- * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data. \r
- * See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about \r
+ * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.\r
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about\r
* accessing elements of the response.</div></li>\r
* </ul></div></li>\r
* <li><a id="request-option-success"></a><b>success</b> : Function (Optional)<div class="sub-desc">The function\r
* <li><b>timeout</b> : Number (Optional)<div class="sub-desc">The timeout in milliseconds to be used for this request. Defaults to 30 seconds.</div></li>\r
* <li><b>form</b> : Element/HTMLElement/String (Optional)<div class="sub-desc">The <tt><form></tt>\r
* Element or the id of the <tt><form></tt> to pull parameters from.</div></li>\r
- * <li><a id="request-option-isUpload"></a><b>isUpload</b> : Boolean (Optional)<div class="sub-desc"><b>Only meaningful when used \r
+ * <li><a id="request-option-isUpload"></a><b>isUpload</b> : Boolean (Optional)<div class="sub-desc"><b>Only meaningful when used\r
* with the <tt>form</tt> option</b>.\r
* <p>True if the form object is a file upload (will be set automatically if the form was\r
* configured with <b><tt>enctype</tt></b> "multipart/form-data").</p>\r
me.indicatorText = '<div class="loading-indicator">'+o.indicatorText+"</div>";\r
}\r
if(me.indicatorText) {\r
- Ext.getDom(o.el).innerHTML = me.indicatorText; \r
+ Ext.getDom(o.el).innerHTML = me.indicatorText;\r
}\r
o.success = (Ext.isFunction(o.success) ? o.success : function(){}).createInterceptor(function(response) {\r
Ext.getDom(o.el).innerHTML = response.responseText;\r
});\r
}\r
- \r
+\r
var p = o.params,\r
- url = o.url || me.url, \r
+ url = o.url || me.url,\r
method,\r
cb = {success: me.handleResponse,\r
failure: me.handleFailure,\r
argument: {options: o},\r
timeout : o.timeout || me.timeout\r
},\r
- form, \r
- serForm; \r
- \r
- \r
+ form,\r
+ serForm;\r
+\r
+\r
if (Ext.isFunction(p)) {\r
p = p.call(o.scope||WINDOW, o);\r
}\r
- \r
- p = Ext.urlEncode(me.extraParams, Ext.isObject(p) ? Ext.urlEncode(p) : p); \r
- \r
+\r
+ p = Ext.urlEncode(me.extraParams, Ext.isObject(p) ? Ext.urlEncode(p) : p);\r
+\r
if (Ext.isFunction(url)) {\r
url = url.call(o.scope || WINDOW, o);\r
}\r
- \r
+\r
if((form = Ext.getDom(o.form))){\r
url = url || form.action;\r
- if(o.isUpload || /multipart\/form-data/i.test(form.getAttribute("enctype"))) { \r
+ if(o.isUpload || /multipart\/form-data/i.test(form.getAttribute("enctype"))) {\r
return me.doFormUpload.call(me, o, p, url);\r
}\r
- serForm = Ext.lib.Ajax.serializeForm(form); \r
+ serForm = Ext.lib.Ajax.serializeForm(form);\r
p = p ? (p + '&' + serForm) : serForm;\r
}\r
- \r
+\r
method = o.method || me.method || ((p || o.xmlData || o.jsonData) ? POST : GET);\r
- \r
+\r
if(method === GET && (me.disableCaching && o.disableCaching !== false) || o.disableCaching === true){\r
var dcp = o.disableCachingParam || me.disableCachingParam;\r
url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime()));\r
}\r
- \r
+\r
o.headers = Ext.apply(o.headers || {}, me.defaultHeaders || {});\r
- \r
+\r
if(o.autoAbort === true || me.autoAbort) {\r
me.abort();\r
}\r
- \r
+\r
if((method == GET || o.xmlData || o.jsonData) && p){\r
- url = Ext.urlAppend(url, p); \r
+ url = Ext.urlAppend(url, p);\r
p = '';\r
}\r
return (me.transId = Ext.lib.Ajax.request(method, url, cb, p, o));\r
- }else{ \r
+ }else{\r
return o.callback ? o.callback.apply(o.scope, [o,UNDEFINED,UNDEFINED]) : null;\r
}\r
},\r
- \r
+\r
<div id="method-Ext.data.Connection-isLoading"></div>/**\r
* Determine whether this object has a request outstanding.\r
* @param {Number} transactionId (Optional) defaults to the last transaction\r
* @return {Boolean} True if there is an outstanding request.\r
*/\r
isLoading : function(transId){\r
- return transId ? Ext.lib.Ajax.isCallInProgress(transId) : !! this.transId; \r
+ return transId ? Ext.lib.Ajax.isCallInProgress(transId) : !! this.transId;\r
},\r
- \r
+\r
<div id="method-Ext.data.Connection-abort"></div>/**\r
* Aborts any outstanding request.\r
* @param {Number} transactionId (Optional) defaults to the last transaction\r
Ext.fly(frame).set({\r
id: id,\r
name: id,\r
- cls: 'x-hidden',\r
- src: Ext.SSL_SECURE_URL // for IE\r
+ cls: 'x-hidden'\r
+\r
});\r
+\r
doc.body.appendChild(frame);\r
\r
+ //Reset the Frame to neutral domain\r
+ Ext.fly(frame).set({\r
+ src : Ext.SSL_SECURE_URL\r
+ });\r
+\r
// This is required so that IE doesn't pop the response up in a new window.\r
if(Ext.isIE){\r
document.frames[id].name = id;\r
}\r
\r
+\r
Ext.fly(form).set({\r
target: id,\r
method: POST,\r
Ext.Ajax.defaultHeaders = {\r
'Powered-By': 'Ext'\r
};\r
- * </code></pre> \r
+ * </code></pre>\r
* </p>\r
* <p>Common <b>Events</b> you may want to set are:<div class="mdetail-params"><ul>\r
* <li><b><tt>{@link Ext.data.Connection#beforerequest beforerequest}</tt></b><p class="sub-desc"></p></li>\r
Ext.Ajax.on('beforerequest', this.showSpinner, this);\r
Ext.Ajax.on('requestcomplete', this.hideSpinner, this);\r
Ext.Ajax.on('requestexception', this.hideSpinner, this);\r
- * </code></pre> \r
+ * </code></pre>\r
* </p>\r
* <p>An example request:</p>\r
* <pre><code>\r
form: 'some-form',\r
params: 'foo=bar'\r
});\r
- * </code></pre> \r
+ * </code></pre>\r
* </p>\r
* @singleton\r
*/\r