Observable Updater
Package: | Ext |
Defined In: | UpdateManager.js |
Class: | Updater |
Extends: | Observable |
var el = Ext.get("foo"); // Get Ext.Element object
var mgr = el.getUpdater();
mgr.update({
url: "http://myserver.com/index.php",
params: {
param1: "foo",
param2: "bar"
}
});
...
mgr.formUpdate("myFormId", "http://myserver.com/index.php");
// or directly (returns the same Updater instance)
var mgr = new Ext.Updater("myElementId");
mgr.startAutoRefresh(60, "http://myserver.com/index.php");
mgr.on("update", myFcnNeedsToKnow);
// short handed call directly from the element object
Ext.get("foo").load({
url: "bar.php",
scripts: true,
params: "param1=foo¶m2=bar",
text: "Loading Foo..."
});
Config Options | Defined By | |
---|---|---|
listeners : Object A config object containing one or more event handlers to be added to this
object during initialization. This should ... A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once. DOM events from ExtJs Components While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
is usually only done when extra value can be added. For example the DataView's
| Observable |
Property | Defined By | |
---|---|---|
defaultUrl : String Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true. | Updater | |
disableCaching : Boolean Whether to append unique parameter on get request to disable caching (defaults to Ext.Updater.defaults.disableCaching... Whether to append unique parameter on get request to disable caching (defaults to Ext.Updater.defaults.disableCaching). | Updater | |
el : Ext.Element The Element object | Updater | |
formUpdateDelegate : Function Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arg... Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments | Updater | |
indicatorText : String Text for loading indicator (defaults to Ext.Updater.defaults.indicatorText). | Updater | |
loadScripts : Boolean True to process scripts in the output (defaults to Ext.Updater.defaults.loadScripts). | Updater | |
refreshDelegate : Function Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments | Updater | |
renderer : Object The renderer for this Updater (defaults to Ext.Updater.BasicRenderer). | Updater | |
showLoadIndicator : String Whether to show indicatorText when loading (defaults to Ext.Updater.defaults.showLoadIndicator). | Updater | |
sslBlankUrl : String Blank page URL to use with SSL file uploads (defaults to Ext.Updater.defaults.sslBlankUrl). | Updater | |
timeout : Number Timeout for requests or form posts in seconds (defaults to Ext.Updater.defaults.timeout). | Updater | |
transaction : Object Transaction object of the current executing transaction, or null if there is no active transaction. | Updater | |
updateDelegate : Function Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments | Updater |
Method | Defined By | |
---|---|---|
Updater( Mixed el , [Boolean forceNew ] )
Create new Updater directly. Create new Updater directly. Parameters:
| Updater | |
Updater.updateElement( Mixed el , String url , [String/Object params ], [Object options ] )
:
void<static> Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).
Usage:
Ext.Updater.up... <static> Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).
Usage:
Parameters:
| Updater | |
abort()
:
void Aborts the currently executing transaction, if any. Aborts the currently executing transaction, if any. Parameters:
| Updater | |
addEvents( Object object )
:
voidUsed to define events on this Observable Used to define events on this Observable Parameters:
| Observable | |
addListener( String eventName , Function handler , [Object scope ], [Object options ] )
:
voidAppends an event handler to this object. Appends an event handler to this object. Parameters:
| Observable | |
enableBubble( Object events )
:
voidUsed to enable bubbling of events Used to enable bubbling of events Parameters:
| Observable | |
fireEvent( String eventName , Object... args )
:
BooleanFires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse... Fires the specified event with the passed parameters (minus the event name). An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget) by calling enableBubble. Parameters:
| Observable | |
formUpdate( String/HTMLElement form , [String url ], [Boolean reset ], [Function callback ] )
:
voidPerforms an async form post, updating this element with the response. If the form has the attribute
enctype="<a href=... 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. File uploads are not performed using normal "Ajax" techniques, that is they are not performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the DOM <form> element temporarily modified to have its target set to refer to a dynamically generated, hidden <iframe> which is inserted into the document but removed after the return data has been gathered. Be aware that file upload packets, sent with the content type multipart/form-data and some server technologies (notably JEE) may require some custom processing in order to retrieve parameter names and parameter values from the packet content. Parameters:
| Updater | |
getDefaultRenderer()
:
void This is an overrideable method which returns a reference to a default
renderer class if none is specified when creati... This is an overrideable method which returns a reference to a default
renderer class if none is specified when creating the Ext.Updater.
Defaults to Ext.Updater.BasicRenderer Parameters:
| Updater | |
getEl()
:
Ext.Element Get the Element this Updater is bound to Get the Element this Updater is bound to Parameters:
| Updater | |
getRenderer()
:
Object Returns the current content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details. Returns the current content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details. Parameters:
| Updater | |
hasListener( String eventName )
:
BooleanChecks to see if this object has any listeners for a specified event Checks to see if this object has any listeners for a specified event Parameters:
| Observable | |
isAutoRefreshing()
:
void Returns true if the Updater is currently set to auto refresh its content (see startAutoRefresh), otherwise false. Returns true if the Updater is currently set to auto refresh its content (see startAutoRefresh), otherwise false. Parameters:
| Updater | |
isUpdating()
:
Boolean Returns true if an update is in progress, otherwise false. Returns true if an update is in progress, otherwise false. Parameters:
| Updater | |
on( String eventName , Function handler , [Object scope ], [Object options ] )
:
voidAppends an event handler to this object (shorthand for addListener.) Appends an event handler to this object (shorthand for addListener.) Parameters:
| Observable | |
purgeListeners()
:
void Removes all listeners for this object Removes all listeners for this object Parameters:
| Observable | |
refresh( [Function callback ] )
:
voidRefresh the element with the last used url or defaultUrl. If there is no url, it returns immediately Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately Parameters:
| Updater | |
relayEvents( Object o , Array events )
:
voidRelays selected events from the specified Observable as if the events were fired by this. Relays selected events from the specified Observable as if the events were fired by this. Parameters:
| Observable | |
removeListener( String eventName , Function handler , [Object scope ] )
:
voidRemoves an event handler. Removes an event handler. Parameters:
| Observable | |
resumeEvents()
:
void Resume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
event... Resume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
events fired during event suspension will be sent to any listeners now. Parameters:
| Observable | |
setDefaultUrl( String/Function defaultUrl )
:
voidSets the default URL used for updates. Sets the default URL used for updates. Parameters:
| Updater | |
setRenderer( Object renderer )
:
voidSets the content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details. Sets the content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details. Parameters:
| Updater | |
showLoading()
:
void Display the element's "loading" state. By default, the element is updated with indicatorText. This
method may be over... Display the element's "loading" state. By default, the element is updated with indicatorText. This
method may be overridden to perform a custom action while this Updater is actively updating its contents. Parameters:
| Updater | |
startAutoRefresh( Number interval , [String/Object/Function url ], [String/Object params ], [Function callback ], [Boolean refreshNow ] )
:
voidSet this element to auto refresh. Can be canceled by calling stopAutoRefresh. Set this element to auto refresh. Can be canceled by calling stopAutoRefresh. Parameters:
| Updater | |
stopAutoRefresh()
:
void Stop auto refresh on this element. Stop auto refresh on this element. Parameters:
| Updater | |
suspendEvents( Boolean queueSuspended )
:
voidSuspend the firing of all events. (see resumeEvents) Suspend the firing of all events. (see resumeEvents) Parameters:
| Observable | |
un( String eventName , Function handler , [Object scope ] )
:
voidRemoves an event handler (shorthand for removeListener.) Removes an event handler (shorthand for removeListener.) Parameters:
| Observable | |
update( Object options )
:
voidPerforms an asynchronous request, updating this element with the response.
If params are specified it uses POST, othe... Performs an asynchronous request, updating this element with the response.
If params are specified it uses POST, otherwise it uses GET. Note: Due to the asynchronous nature of remote server requests, the Element will not have been fully updated when the function returns. To post-process the returned data, use the callback option, or an update event handler. Parameters:
| Updater |
Event | Defined By | |
---|---|---|
beforeupdate :
( Ext.Element el , String/Object/Function url , String/Object params )
Fired before an update is made, return false from your handler and the update is cancelled. Fired before an update is made, return false from your handler and the update is cancelled. Listeners will be called with the following arguments:
| Updater | |
failure :
( Ext.Element el , Object oResponseObject )
Fired on update failure. Fired on update failure. Listeners will be called with the following arguments:
| Updater | |
update :
( Ext.Element el , Object oResponseObject )
Fired after successful update is made. Fired after successful update is made. Listeners will be called with the following arguments:
| Updater |