184 lines
No EOL
9.4 KiB
HTML
184 lines
No EOL
9.4 KiB
HTML
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>Ext.data.Connection</title>
|
|
<link rel="stylesheet" type="text/css" href="../resources/reset.css"/>
|
|
<link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/>
|
|
<link rel="stylesheet" type="text/css" href="../resources/print.css" media="print">
|
|
<!-- GC -->
|
|
</head>
|
|
<body>
|
|
<div class="body-wrap">
|
|
<div class="top-tools">
|
|
<img src="../resources/print.gif" width="16" height="16" align="absmiddle"> <a href="Ext.data.Connection.html" target="_blank">Print Friendly</a><br/>
|
|
|
|
</div>
|
|
<h1>Class Ext.data.Connection</h1>
|
|
<table cellspacing="0">
|
|
<tr><td class="label">Package:</td><td>Ext.data</td></tr>
|
|
<tr><td class="label">Class:</td><td>Connection</td></tr>
|
|
<tr><td class="label">Extends:</td><td>Object</td></tr>
|
|
<tr><td class="label">Defined In:</td><td><a href="Connection.jss.html">Connection.js</a></td></tr>
|
|
</table>
|
|
<div class="description">
|
|
The class encapsulates a connection to the page's originating domain, allowing requests to be made
|
|
either to a configured URL, or to a URL specified at request time.
|
|
<p>
|
|
Requests made by this class are asynchronous, and will return immediately, and no data from
|
|
the server will be available. To process the returned data, us a callback in the request options
|
|
object. </div>
|
|
<br />
|
|
<a href="#properties">Properties</a>
|
|
- <a href="#methods">Methods</a>
|
|
- <a href="#events">Events</a>
|
|
- <a href="#configs">Config Options</a>
|
|
<hr />
|
|
<a name="properties"></a>
|
|
<h2>Public Properties</h2>
|
|
<div class="no-members">This class has no public properties.</div> <a name="methods"></a>
|
|
<h2>Public Methods</h2>
|
|
<table cellspacing="0" class="member-table">
|
|
<tr>
|
|
<th class="sig-header" colspan="2">Method</th>
|
|
<th class="msource-header">Defined By</th>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#Connection">Connection</a>(<code>config {Object}</code>)</td>
|
|
<td class="msource" rowspan="2">Connection</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc"></td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#abort">abort</a>() : void</td>
|
|
<td class="msource" rowspan="2">Connection</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Aborts any outstanding request.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#isLoading">isLoading</a>() : Boolean</td>
|
|
<td class="msource" rowspan="2">Connection</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Determine whether this object has a request outstanding.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#request">request</a>(<span class="optional" title="Optional">[<code>Object options.</code>]</span>) : void</td>
|
|
<td class="msource" rowspan="2">Connection</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Sends an HTTP request to a remote server.</td>
|
|
</tr>
|
|
</table>
|
|
<a name="events"></a>
|
|
<h2>Public Events</h2>
|
|
<div class="no-members">This class has no public events.</div> <a name="configs"></a>
|
|
<h2>Config Options</h2>
|
|
<table cellspacing="0" class="member-table">
|
|
<tr>
|
|
<th class="sig-header" colspan="2">Config Options</th>
|
|
<th class="msource-header">Defined By</th>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#config-{Number}">{Number}</a> : timeout</td>
|
|
<td class="msource" rowspan="2">Connection</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">(Optional) The timeout in milliseconds to be used for requests. Defaults to 30000.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<a name="Connection"></a>
|
|
<h2 class="mdetail-head">Constructor Details</h2>
|
|
<div class="detail-wrap">
|
|
<div class="mdetail">
|
|
<h3>Connection</i></h3>
|
|
<code>public function Connection(<code>config {Object}</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>{Object}</code> : config<div class="sub-desc">a configuration object.</div></li> </ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h2 class="mdetail-head">Method Details</h2>
|
|
<div class="detail-wrap">
|
|
<a name="abort"></a>
|
|
<div class="mdetail">
|
|
<h3>abort</i></h3>
|
|
<code>public function abort()</code>
|
|
<div class="mdetail-desc">
|
|
Aborts any outstanding request.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by Connection.</div>
|
|
</div>
|
|
<a name="isLoading"></a>
|
|
<div class="mdetail alt">
|
|
<h3>isLoading</i></h3>
|
|
<code>public function isLoading()</code>
|
|
<div class="mdetail-desc">
|
|
Determine whether this object has a request outstanding.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>Boolean</code><div class="sub-desc">True if there is an outstanding request.</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by Connection.</div>
|
|
</div>
|
|
<a name="request"></a>
|
|
<div class="mdetail">
|
|
<h3>request</i></h3>
|
|
<code>public function request(<span class="optional" title="Optional">[<code>Object options.</code>]</span>)</code>
|
|
<div class="mdetail-desc">
|
|
Sends an HTTP request to a remote server.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>options.</code> : Object<div class="sub-desc">An object which may contain the following properties:<ul> <li>url {String} (Optional) The URL to which to send the request. Defaults to configured URL</li> <li>params {Object} (Optional) An object containing properties which are used as extra parameters to the request</li> <li>method {String} (Optional) The HTTP method to use for the request. Defaults to the configured method, or if no method was configured, "GET" if no parameters are being sent, and "POST" if parameters are being sent.</li> <li>callback {Function} (Optional) The function to be called upon receipt of the HTTP response. The callback is passed the following parameters:<ul> <li>options {Object} The parameter to the request call.</li> <li>success {Boolean} True if the request succeeded.</li> <li>resopnse {Object} The XMLHttpRequest object containing the response data.</li> </ul></li> <li>scope {Object} (Optional) The scope in which to execute the callback: The "this" object for the callback function. Defaults to the browser window.</li> </ul></div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by Connection.</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h2 class="mdetail-head">Config Details</h2>
|
|
<div class="detail-wrap">
|
|
<a name="config-{Number}"></a>
|
|
<div class="mdetail">
|
|
<h3>{Number}</i></h3>
|
|
<code>{Number} : timeout</code>
|
|
<div class="mdetail-desc">
|
|
(Optional) The timeout in milliseconds to be used for requests. Defaults to 30000. </div>
|
|
<div class="mdetail-def">This config option is defined by Connection.</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<hr>
|
|
<div style="font-size:10px;text-align:center;color:gray;">Ext - Copyright © 2006-2007 Ext JS, LLC<br />All rights reserved.</div>
|
|
|
|
</body>
|
|
</html> |