webgui/www/extras/extjs/docs/output/Ext.UpdateManager.html

890 lines
No EOL
56 KiB
HTML

<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Ext.UpdateManager</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">&nbsp;<a href="Ext.UpdateManager.html" target="_blank">Print Friendly</a><br/>
</div>
<h1>Class Ext.UpdateManager</h1>
<table cellspacing="0">
<tr><td class="label">Package:</td><td>Ext</td></tr>
<tr><td class="label">Class:</td><td>UpdateManager</td></tr>
<tr><td class="label">Extends:</td><td><a href="Ext.util.Observable.html">Observable</a></td></tr>
<tr><td class="label">Defined In:</td><td><a href="UpdateManager.jss.html">UpdateManager.js</a></td></tr>
</table>
<div class="description">
Provides AJAX-style update for Element object.<br><br>
Usage:<br>
<pre class="highlighted"><code><i>// Get it from a Ext.Element object</i>
<b>var</b> el = Ext.get("foo");
<b>var</b> mgr = el.getUpdateManager();
mgr.update("http:<i>//myserver.com/index.php", "param1=1&amp;param2=2");</i>
...
mgr.formUpdate("myFormId", "http:<i>//myserver.com/index.php");</i>
<br>
<i>// or directly (returns the same UpdateManager instance)</i>
<b>var</b> mgr = <b>new</b> Ext.UpdateManager("myElementId");
mgr.startAutoRefresh(60, "http:<i>//myserver.com/index.php");</i>
mgr.on("update", myFcnNeedsToKnow);
<br>
<i>// short handed call directly from the element object</i>
Ext.get("foo").load({
url: "bar.php",
scripts:true,
params: "<b>for</b>=bar",
text: "Loading Foo..."
});</code></pre> </div>
<br />
<a href="#properties">Properties</a>
&nbsp;&nbsp;-&nbsp;&nbsp;<a href="#methods">Methods</a>
&nbsp;&nbsp;-&nbsp;&nbsp;<a href="#events">Events</a>
<hr />
<a name="properties"></a>
<h2>Public Properties</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Property</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#defaultUrl">defaultUrl</a> : String</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#disableCaching">disableCaching</a> : Boolean</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Whether to append unique parameter on get request to disable caching (Defaults to Ext.UpdateManager.defaults.disableC...</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#el">el</a> : Ext.Element</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">The Element object</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#formUpdateDelegate">formUpdateDelegate</a> : Function</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arg...</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#indicatorText">indicatorText</a> : String</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Text for loading indicator (Defaults to Ext.UpdateManager.defaults.indicatorText or '&lt;div class="loading-indicator...</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#loadScripts">loadScripts</a> : Boolean</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">True to process scripts in the output (Defaults to Ext.UpdateManager.defaults.loadScripts (false)).</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#refreshDelegate">refreshDelegate</a> : Function</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#renderer">renderer</a> : Object</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">The renderer for this UpdateManager. Defaults to <a href="Ext.UpdateManager.BasicRenderer.html">Ext.UpdateManager.BasicRenderer</a>.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#showLoadIndicator">showLoadIndicator</a> : String</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Whether to show indicatorText when loading (Defaults to Ext.UpdateManager.defaults.showLoadIndicator or true).</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#sslBlankUrl">sslBlankUrl</a> : String</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Blank page URL to use with SSL file uploads (Defaults to Ext.UpdateManager.defaults.sslBlankUrl or "about:blank").</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#timeout">timeout</a> : Number</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Timeout for requests or form posts in seconds (Defaults to Ext.UpdateManager.defaults.timeout or 30 seconds).</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#transaction">transaction</a> : Object</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Transaction object of current executing transaction</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#updateDelegate">updateDelegate</a> : Function</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments</td>
</tr>
</table>
<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">&nbsp;</td>
<td class="sig"><a class="mlink" href="#UpdateManager">UpdateManager</a>(<code>String/HTMLElement/Ext.Element el</code>, <span class="optional" title="Optional">[<code>Boolean forceNew</code>]</span>)</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Create new UpdateManager directly.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#UpdateManager.updateElement">UpdateManager.updateElement</a>(<code>String/HTMLElement/Ext.Element el</code>, <code>String url</code>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Deprecated. &lt;static&gt; Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ....</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#abort">abort</a>() : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Aborts the executing transaction</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#addEvents">addEvents</a>(<code>Object object</code>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#addEvents">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Copies any events from the passed object onto this object if they do not already exist. The passed object
must also ...</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#addListener">addListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#addListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Appends an event handler to this component</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#fireEvent">fireEvent</a>(<code>String eventName</code>, <code>Object... args</code>) : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#fireEvent">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Fires the specified event with the passed parameters (minus the event name).</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#formUpdate">formUpdate</a>(<code>String/HTMLElement form</code>, <span class="optional" title="Optional">[<code>String url</code>]</span>, <span class="optional" title="Optional">[<code>Boolean reset</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Performs an async form post, updating this element with the response. If the form has the attribute enctype="multipar...</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getEl">getEl</a>() : Ext.Element</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Get the Element this UpdateManager is bound to</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#hasListener">hasListener</a>(<code>String eventName</code>) : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#hasListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Checks to see if this object is currently listening for a specified event</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#isUpdating">isUpdating</a>() : Boolean</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Returns true if an update is in progress</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#on">on</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object options</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#on">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Appends an event handler to this element (shorthand for addListener)</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#purgeListeners">purgeListeners</a>() : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#purgeListeners">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Removes all listeners for this object</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#refresh">refresh</a>(<span class="optional" title="Optional">[<code>Function callback</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#removeListener">removeListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#removeListener">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Removes a listener</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setDefaultUrl">setDefaultUrl</a>(<code>String/Function defaultUrl</code>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Set the defaultUrl used for updates</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setRenderer">setRenderer</a>(<code>Object renderer</code>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Set the content renderer for this UpdateManager. See <a href="Ext.UpdateManager.BasicRenderer.html#render">Ext.UpdateManager.BasicRenderer.render</a> for more details.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#showLoading">showLoading</a>() : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Called to update the element to "Loading" state. Override to perform custom action.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#startAutoRefresh">startAutoRefresh</a>(<code>Number interval</code>, <span class="optional" title="Optional">[<code>String/Function url</code>]</span>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>, <span class="optional" title="Optional">[<code>Boolean refreshNow</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Set this element to auto refresh.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#stopAutoRefresh">stopAutoRefresh</a>() : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Stop auto refresh on this element.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#un">un</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#un">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Removes a listener (shorthand for removeListener)</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#update">update</a>(<code>Object/String/Function url</code>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>, <span class="optional" title="Optional">[<code>Boolean discardUrl</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Performs an async request, updating this element with the response. If params are specified it uses POST, otherwise i...</td>
</tr>
</table>
<a name="events"></a>
<h2>Public Events</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Event</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-beforeupdate">beforeupdate</a> : (<code>Ext.Element el</code>, <code>String/Object/Function url</code>, <code>String/Object params</code>)</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Fired before an update is made, return false from your handler and the update is cancelled.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-failure">failure</a> : (<code>Ext.Element el</code>, <code>Object oResponseObject</code>)</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Fired on update failure.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-update">update</a> : (<code>Ext.Element el</code>, <code>Object oResponseObject</code>)</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Fired after successful update is made.</td>
</tr>
</table>
<h2 class="mdetail-head">Property Details</h2>
<div class="detail-wrap">
<a name="defaultUrl"></a>
<div class="mdetail">
<h3>defaultUrl</i></h3>
<code>public String defaultUrl</code>
<div class="mdetail-desc">
Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true. </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="disableCaching"></a>
<div class="mdetail alt">
<h3>disableCaching</i></h3>
<code>public Boolean disableCaching</code>
<div class="mdetail-desc">
Whether to append unique parameter on get request to disable caching (Defaults to Ext.UpdateManager.defaults.disableCaching or false). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="el"></a>
<div class="mdetail">
<h3>el</i></h3>
<code>public Ext.Element el</code>
<div class="mdetail-desc">
The Element object </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="formUpdateDelegate"></a>
<div class="mdetail alt">
<h3>formUpdateDelegate</i></h3>
<code>public Function formUpdateDelegate</code>
<div class="mdetail-desc">
Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="indicatorText"></a>
<div class="mdetail">
<h3>indicatorText</i></h3>
<code>public String indicatorText</code>
<div class="mdetail-desc">
Text for loading indicator (Defaults to Ext.UpdateManager.defaults.indicatorText or '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;'). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="loadScripts"></a>
<div class="mdetail alt">
<h3>loadScripts</i></h3>
<code>public Boolean loadScripts</code>
<div class="mdetail-desc">
True to process scripts in the output (Defaults to Ext.UpdateManager.defaults.loadScripts (false)). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="refreshDelegate"></a>
<div class="mdetail">
<h3>refreshDelegate</i></h3>
<code>public Function refreshDelegate</code>
<div class="mdetail-desc">
Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="renderer"></a>
<div class="mdetail alt">
<h3>renderer</i></h3>
<code>public Object renderer</code>
<div class="mdetail-desc">
The renderer for this UpdateManager. Defaults to <a href="Ext.UpdateManager.BasicRenderer.html">Ext.UpdateManager.BasicRenderer</a>. </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="showLoadIndicator"></a>
<div class="mdetail">
<h3>showLoadIndicator</i></h3>
<code>public String showLoadIndicator</code>
<div class="mdetail-desc">
Whether to show indicatorText when loading (Defaults to Ext.UpdateManager.defaults.showLoadIndicator or true). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="sslBlankUrl"></a>
<div class="mdetail alt">
<h3>sslBlankUrl</i></h3>
<code>public String sslBlankUrl</code>
<div class="mdetail-desc">
Blank page URL to use with SSL file uploads (Defaults to Ext.UpdateManager.defaults.sslBlankUrl or "about:blank"). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="timeout"></a>
<div class="mdetail">
<h3>timeout</i></h3>
<code>public Number timeout</code>
<div class="mdetail-desc">
Timeout for requests or form posts in seconds (Defaults to Ext.UpdateManager.defaults.timeout or 30 seconds). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="transaction"></a>
<div class="mdetail alt">
<h3>transaction</i></h3>
<code>public Object transaction</code>
<div class="mdetail-desc">
Transaction object of current executing transaction </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="updateDelegate"></a>
<div class="mdetail">
<h3>updateDelegate</i></h3>
<code>public Function updateDelegate</code>
<div class="mdetail-desc">
Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
</div>
<a name="UpdateManager"></a>
<h2 class="mdetail-head">Constructor Details</h2>
<div class="detail-wrap">
<div class="mdetail">
<h3>UpdateManager</i></h3>
<code>public function UpdateManager(<code>String/HTMLElement/Ext.Element el</code>, <span class="optional" title="Optional">[<code>Boolean forceNew</code>]</span>)</code>
<div class="mdetail-desc">
Create new UpdateManager directly. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement/Ext.Element<div class="sub-desc">The element to update</div></li><li><code>forceNew</code> : Boolean<div class="sub-desc">(optional) By default the constructor checks to see if the passed element already has an UpdateManager and if it does it returns the same instance. This will skip that check (useful for extending this class).</div></li> </ul>
</div>
</div>
</div>
</div>
<h2 class="mdetail-head">Method Details</h2>
<div class="detail-wrap">
<a name="UpdateManager.updateElement"></a>
<div class="mdetail">
<h3>UpdateManager.updateElement</i></h3>
<code>public function UpdateManager.updateElement(<code>String/HTMLElement/Ext.Element el</code>, <code>String url</code>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span>)</code>
<div class="mdetail-desc">
<b>Deprecated.</b> &lt;static&gt; Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).
Usage:
<pre><code>Ext.UpdateManager.updateElement("my-div", "stuff.php");</code></pre>
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement/Ext.Element<div class="sub-desc">The element to update</div></li><li><code>url</code> : String<div class="sub-desc">The url</div></li><li><code>params</code> : String/Object<div class="sub-desc">(optional) Url encoded param string or an object of name/value pairs</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) A config object with any of the UpdateManager properties you want to set - for example: {disableCaching:true, indicatorText: "Loading data..."}</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="abort"></a>
<div class="mdetail alt">
<h3>abort</i></h3>
<code>public function abort()</code>
<div class="mdetail-desc">
Aborts the executing transaction
<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 UpdateManager.</div>
</div>
<a name="addEvents"></a>
<div class="mdetail">
<h3>addEvents</i></h3>
<code>public function addEvents(<code>Object object</code>)</code>
<div class="mdetail-desc">
Copies any events from the passed object onto this object if they do not already exist. The passed object
must also inherit from Observable for this method to have any effect.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>object</code> : Object<div class="sub-desc">The object from which to copy events</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#addEvents">Observable</a>.</div>
</div>
<a name="addListener"></a>
<div class="mdetail alt">
<h3>addListener</i></h3>
<code>public function addListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span>)</code>
<div class="mdetail-desc">
Appends an event handler to this component
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration properties. This may contain any of the following properties:<ul> <li>scope {Object} The scope in which to execute the handler function. The handler function's "this" context.</li> <li>delegate {String} A simple selector to filter the target or look for a descendant of the target</li> <li>stopEvent {Boolean} True to stop the event. That is stop propagation, and prevent the default action.</li> <li>preventDefault {Boolean} True to prevent the default action</li> <li>stopPropagation {Boolean} True to prevent event propagation</li> <li>normalized {Boolean} False to pass a browser event to the handler function instead of an Ext.EventObject</li> <li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li> <li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li> <li>buffer {Number} Causes the handler to be scheduled to run in an <a href="Ext.util.DelayedTask.html">Ext.util.DelayedTask</a> delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li> </ul> <p> <b>Combining Options</b><br> Using the options argument, it is possible to combine different types of listeners:<br> <br> A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)<div style="margin: 5px 20px 20px;"> Code: <pre><code>el.on('click', this.onClick, this, { single: true, delay: 100, stopEvent : true, forumId: 4 });</pre> <p> The method also allows for a single argument to be passed which is a config object containing properties which specify multiple handlers. <p> <b>Attaching multiple handlers in 1 call</b><br> Code: <pre><code>el.on({ 'click' : { fn: this.onClick scope: this, delay: 100 }, 'mouseover' : { fn: this.onMouseOver scope: this }, 'mouseout' : { fn: this.onMouseOut scope: this } });</pre> <p> Or a shorthand syntax:<br> Code: <pre><code>el.on({ 'click' : this.onClick, 'mouseover' : this.onMouseOver, 'mouseout' : this.onMouseOut scope: this });</pre></div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#addListener">Observable</a>.</div>
</div>
<a name="fireEvent"></a>
<div class="mdetail">
<h3>fireEvent</i></h3>
<code>public function fireEvent(<code>String eventName</code>, <code>Object... args</code>)</code>
<div class="mdetail-desc">
Fires the specified event with the passed parameters (minus the event name).
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc"></div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#fireEvent">Observable</a>.</div>
</div>
<a name="formUpdate"></a>
<div class="mdetail alt">
<h3>formUpdate</i></h3>
<code>public function formUpdate(<code>String/HTMLElement form</code>, <span class="optional" title="Optional">[<code>String url</code>]</span>, <span class="optional" title="Optional">[<code>Boolean reset</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>)</code>
<div class="mdetail-desc">
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.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>form</code> : String/HTMLElement<div class="sub-desc">The form Id or form element</div></li><li><code>url</code> : String<div class="sub-desc">(optional) The url to pass the form to. If omitted the action attribute on the form will be used.</div></li><li><code>reset</code> : Boolean<div class="sub-desc">(optional) Whether to try to reset the form after the update</div></li><li><code>callback</code> : Function<div class="sub-desc">(optional) Callback when transaction is complete - called with signature (oElement, bSuccess, oResponse)</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="getEl"></a>
<div class="mdetail">
<h3>getEl</i></h3>
<code>public function getEl()</code>
<div class="mdetail-desc">
Get the Element this UpdateManager is bound to
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Ext.Element</code><div class="sub-desc">The element</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="hasListener"></a>
<div class="mdetail alt">
<h3>hasListener</i></h3>
<code>public function hasListener(<code>String eventName</code>)</code>
<div class="mdetail-desc">
Checks to see if this object is currently listening for a specified event
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#hasListener">Observable</a>.</div>
</div>
<a name="isUpdating"></a>
<div class="mdetail">
<h3>isUpdating</i></h3>
<code>public function isUpdating()</code>
<div class="mdetail-desc">
Returns true if an update is in progress
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="on"></a>
<div class="mdetail alt">
<h3>on</i></h3>
<code>public function on(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object options</code>]</span>)</code>
<div class="mdetail-desc">
Appends an event handler to this element (shorthand for addListener)
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#on">Observable</a>.</div>
</div>
<a name="purgeListeners"></a>
<div class="mdetail">
<h3>purgeListeners</i></h3>
<code>public function purgeListeners()</code>
<div class="mdetail-desc">
Removes all listeners for this object
<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 <a href="Ext.util.Observable.html#purgeListeners">Observable</a>.</div>
</div>
<a name="refresh"></a>
<div class="mdetail alt">
<h3>refresh</i></h3>
<code>public function refresh(<span class="optional" title="Optional">[<code>Function callback</code>]</span>)</code>
<div class="mdetail-desc">
Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>callback</code> : Function<div class="sub-desc">(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="removeListener"></a>
<div class="mdetail">
<h3>removeListener</i></h3>
<code>public function removeListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>)</code>
<div class="mdetail-desc">
Removes a listener
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#removeListener">Observable</a>.</div>
</div>
<a name="setDefaultUrl"></a>
<div class="mdetail alt">
<h3>setDefaultUrl</i></h3>
<code>public function setDefaultUrl(<code>String/Function defaultUrl</code>)</code>
<div class="mdetail-desc">
Set the defaultUrl used for updates
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>defaultUrl</code> : String/Function<div class="sub-desc">The url or a function to call to get the url</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="setRenderer"></a>
<div class="mdetail">
<h3>setRenderer</i></h3>
<code>public function setRenderer(<code>Object renderer</code>)</code>
<div class="mdetail-desc">
Set the content renderer for this UpdateManager. See <a href="Ext.UpdateManager.BasicRenderer.html#render">Ext.UpdateManager.BasicRenderer.render</a> for more details.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>renderer</code> : Object<div class="sub-desc">The object implementing the render() method</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="showLoading"></a>
<div class="mdetail alt">
<h3>showLoading</i></h3>
<code>public function showLoading()</code>
<div class="mdetail-desc">
Called to update the element to "Loading" state. Override to perform custom action.
<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 UpdateManager.</div>
</div>
<a name="startAutoRefresh"></a>
<div class="mdetail">
<h3>startAutoRefresh</i></h3>
<code>public function startAutoRefresh(<code>Number interval</code>, <span class="optional" title="Optional">[<code>String/Function url</code>]</span>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>, <span class="optional" title="Optional">[<code>Boolean refreshNow</code>]</span>)</code>
<div class="mdetail-desc">
Set this element to auto refresh.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>interval</code> : Number<div class="sub-desc">How often to update (in seconds).</div></li><li><code>url</code> : String/Function<div class="sub-desc">(optional) The url for this request or a function to call to get the url (Defaults to the last used url)</div></li><li><code>params</code> : String/Object<div class="sub-desc">(optional) The parameters to pass as either a url encoded string "&param1=1&param2=2" or as an object {param1: 1, param2: 2}</div></li><li><code>callback</code> : Function<div class="sub-desc">(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)</div></li><li><code>refreshNow</code> : Boolean<div class="sub-desc">(optional) Whether to execute the refresh now, or wait the interval</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="stopAutoRefresh"></a>
<div class="mdetail alt">
<h3>stopAutoRefresh</i></h3>
<code>public function stopAutoRefresh()</code>
<div class="mdetail-desc">
Stop auto refresh on this element.
<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 UpdateManager.</div>
</div>
<a name="un"></a>
<div class="mdetail">
<h3>un</i></h3>
<code>public function un(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>)</code>
<div class="mdetail-desc">
Removes a listener (shorthand for removeListener)
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#un">Observable</a>.</div>
</div>
<a name="update"></a>
<div class="mdetail alt">
<h3>update</i></h3>
<code>public function update(<code>Object/String/Function url</code>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>, <span class="optional" title="Optional">[<code>Boolean discardUrl</code>]</span>)</code>
<div class="mdetail-desc">
Performs an async request, updating this element with the response. If params are specified it uses POST, otherwise it uses GET.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>url</code> : Object/String/Function<div class="sub-desc">The url for this request or a function to call to get the url or a config object containing any of the following options: <pre><code> um.update({<br/> url: "your-url.php",<br/> params: {param1: "foo", param2: "bar"}, // or a URL encoded string<br/> callback: yourFunction,<br/> scope: yourObject, //(optional scope) <br/> discardUrl: false, <br/> nocache: false,<br/> text: "Loading...",<br/> timeout: 30,<br/> scripts: false<br/> }); </code></pre> The only required property is url. The optional properties nocache, text and scripts are shorthand for disableCaching, indicatorText and loadScripts and are used to set their associated property on this UpdateManager instance.</div></li><li><code>params</code> : String/Object<div class="sub-desc">(optional) The parameters to pass as either a url encoded string "param1=1&amp;param2=2" or an object {param1: 1, param2: 2}</div></li><li><code>callback</code> : Function<div class="sub-desc">(optional) Callback when transaction is complete - called with signature (oElement, bSuccess, oResponse)</div></li><li><code>discardUrl</code> : Boolean<div class="sub-desc">(optional) By default when you execute an update the defaultUrl is changed to the last used url. If true, it will not store the url.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
</div>
<h2 class="mdetail-head">Event Details</h2>
<div class="detail-wrap">
<a name="event-beforeupdate"></a>
<div class="mdetail">
<h3>beforeupdate</i></h3>
<code>public event beforeupdate</code>
<div class="mdetail-desc">
Fired before an update is made, return false from your handler and the update is cancelled.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>el</code> : Ext.Element<div class="sub-desc"></div></li><li><code>url</code> : String/Object/Function<div class="sub-desc"></div></li><li><code>params</code> : String/Object<div class="sub-desc"></div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by UpdateManager.</div>
</div>
<a name="event-failure"></a>
<div class="mdetail alt">
<h3>failure</i></h3>
<code>public event failure</code>
<div class="mdetail-desc">
Fired on update failure.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>el</code> : Ext.Element<div class="sub-desc"></div></li><li><code>oResponseObject</code> : Object<div class="sub-desc">The response Object</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by UpdateManager.</div>
</div>
<a name="event-update"></a>
<div class="mdetail">
<h3>update</i></h3>
<code>public event update</code>
<div class="mdetail-desc">
Fired after successful update is made.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>el</code> : Ext.Element<div class="sub-desc"></div></li><li><code>oResponseObject</code> : Object<div class="sub-desc">The response Object</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by UpdateManager.</div>
</div>
</div>
</div>
<hr>
<div style="font-size:10px;text-align:center;color:gray;">Ext - Copyright &copy; 2006-2007 Ext JS, LLC<br />All rights reserved.</div>
</body>
</html>