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).
|
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 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 currently executing transaction, if any.
Aborts the currently executing transaction, if any.
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 | |
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 content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details.
Returns the content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details.
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 | |
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 ] ) : 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 | |
relayEvents( Object o , Array events ) : void Relays 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 ] ) : 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 Sets the default URL used for updates.
Sets the default URL used for updates.
Parameters:
|
Updater | |
setRenderer( Object renderer ) : void Sets 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 ] ) : void Set 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() : 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.
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 |