Observable Updater
Package: | Ext |
Defined In: | UpdateManager.js |
Class: | Updater |
Extends: | Observable |
// Get it from a Ext.Element object
var el = Ext.get("foo");
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 b...
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.
|
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 or false).
|
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 or '<div class="loading-indicator">L...
Text for loading indicator (Defaults to Ext.Updater.defaults.indicatorText or '<div class="loading-indicator">Loading...</div>').
|
Updater | |
loadScripts : Boolean
True to process scripts in the output (Defaults to Ext.Updater.defaults.loadScripts (false)).
|
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 or true).
|
Updater | |
sslBlankUrl : String
Blank page URL to use with SSL file uploads (Defaults to Ext.Updater.defaults.sslBlankUrl or "about:blank").
|
Updater | |
timeout : Number
Timeout for requests or form posts in seconds (Defaults to Ext.Updater.defaults.timeout or 30 seconds).
|
Updater | |
transaction : Object
Transaction object of current executing 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 Deprecated. <static> Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ....
Deprecated. <static> Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).
Usage:
Parameters:
|
Updater | |
abort() : void Aborts the executing transaction
Aborts the executing transaction
Parameters:
|
Updater | |
addEvents( Object object ) : void Used to define events on this Observable
Used to define events on this Observable
Parameters:
|
Observable | |
addListener( String eventName , Function handler , [Object scope ], [Object options ] ) : void Appends an event handler to this component
Appends an event handler to this component
Parameters:
|
Observable | |
fireEvent( String eventName , Object... args ) : Boolean Fires the specified event with the passed parameters (minus the event name).
Fires the specified event with the passed parameters (minus the event name).
Parameters:
|
Observable | |
formUpdate( String/HTMLElement form , [String url ], [Boolean reset ], [Function callback ] ) : void Performs an async form post, updating this element with the response. If the form has the attribute enctype="multipar...
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.
Parameters:
|
Updater | |
getEl() : Ext.Element Get the Element this Updater is bound to
Get the Element this Updater is bound to
Parameters:
|
Updater | |
hasListener( String eventName ) : Boolean Checks 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 | |
isUpdating() : Boolean Returns true if an update is in progress
Returns true if an update is in progress
Parameters:
|
Updater | |
on( String eventName , Function handler , [Object scope ], [Object options ] ) : void Appends an event handler to this element (shorthand for addListener)
Appends an event handler to this element (shorthand for addListener)
Parameters:
|
Observable | |
purgeListeners() : void Removes all listeners for this object
Removes all listeners for this object
Parameters:
|
Observable | |
refresh( [Function callback ] ) : void Refresh 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 | |
removeListener( String eventName , Function handler , [Object scope ] ) : void Removes a listener
Removes a listener
Parameters:
|
Observable | |
resumeEvents() : void Resume firing events. (see suspendEvents)
Resume firing events. (see suspendEvents)
Parameters:
|
Observable | |
setDefaultUrl( String/Function defaultUrl ) : void Set the defaultUrl used for updates
Set the defaultUrl used for updates
Parameters:
|
Updater | |
setRenderer( Object renderer ) : void Set the content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details.
Set the content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details.
Parameters:
|
Updater | |
showLoading() : void Called to update the element to "Loading" state. Override to perform custom action.
Called to update the element to "Loading" state. Override to perform custom action.
Parameters:
|
Updater | |
startAutoRefresh( Number interval , [String/Function url ], [String/Object params ], [Function callback ], [Boolean refreshNow ] ) : void Set this element to auto refresh.
Set this element to auto refresh.
Parameters:
|
Updater | |
stopAutoRefresh() : void Stop auto refresh on this element.
Stop auto refresh on this element.
Parameters:
|
Updater | |
suspendEvents() : void Suspend the firing of all events. (see resumeEvents)
Suspend the firing of all events. (see resumeEvents)
Parameters:
|
Observable | |
un( String eventName , Function handler , [Object scope ] ) : void Removes a listener (shorthand for removeListener)
Removes a listener (shorthand for removeListener)
Parameters:
|
Observable | |
update( Object options ) : void Performs 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.
NB: Due to the asynchronous nature of remote server requests, the Element will not have been fully updated when the function returns. To postprocess the returned data, use the callback option, or an update event handler.
Parameters:
|
Updater |