Sencha Documentation

The defaults collection enables customizing the default properties of Updater

Properties

 
defaultUrl : String
Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true.
Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true.
 
disableCaching : Boolean
True to append a unique parameter to GET requests to disable caching (defaults to false).
True to append a unique parameter to GET requests to disable caching (defaults to false).
 
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).
 
el : Ext.Element
The Element object
The Element object
 
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
 
indicatorText : String
Text for loading indicator (defaults to '<div class="loading-indicator">Loading...</div>').
Text for loading indicator (defaults to '<div class="loading-indicator">Loading...</div>').
 
indicatorText : String
Text for loading indicator (defaults to Ext.Updater.defaults.indicatorText).
Text for loading indicator (defaults to Ext.Updater.defaults.indicatorText).
 
loadScripts : Boolean
True to process scripts by default (defaults to false).
True to process scripts by default (defaults to false).
 
loadScripts : Boolean
True to process scripts in the output (defaults to Ext.Updater.defaults.loadScripts).
True to process scripts in the output (defaults to Ext.Updater.defaults.loadScripts).
 
refreshDelegate : Function
Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments
Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments
 
renderer : Object
The renderer for this Updater (defaults to Ext.Updater.BasicRenderer).
The renderer for this Updater (defaults to Ext.Updater.BasicRenderer).
 
Whether or not to show indicatorText during loading (defaults to true).
Whether or not to show indicatorText during loading (defaults to true).
 
Whether to show indicatorText when loading (defaults to Ext.Updater.defaults.showLoadIndicator).
Whether to show indicatorText when loading (defaults to Ext.Updater.defaults.showLoadIndicator).
 
sslBlankUrl : String
Blank page URL to use with SSL file uploads (defaults to Ext.SSL_SECURE_URL if set, or "javascript:false").
Blank page URL to use with SSL file uploads (defaults to Ext.SSL_SECURE_URL if set, or "javascript:false").
 
sslBlankUrl : String
Blank page URL to use with SSL file uploads (defaults to Ext.Updater.defaults.sslBlankUrl).
Blank page URL to use with SSL file uploads (defaults to Ext.Updater.defaults.sslBlankUrl).
 
timeout : Number
Timeout for requests or form posts in seconds (defaults to 30 seconds).
Timeout for requests or form posts in seconds (defaults to 30 seconds).
 
timeout : Number
Timeout for requests or form posts in seconds (defaults to Ext.Updater.defaults.timeout).
Timeout for requests or form posts in seconds (defaults to Ext.Updater.defaults.timeout).
 
transaction : Object
Transaction object of the current executing transaction, or null if there is no active transaction.
Transaction object of the current executing transaction, or null if there is no active transaction.
 
updateDelegate : Function
Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments
Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments

Methods

 
abort : Void
Aborts the currently executing transaction, if any.
Aborts the currently executing transaction, if any.
 
formUpdate( String/HTMLElement form, [String url], [Boolean reset], [Function callback] ) : Void
Performs an asynchronous form post, updating this element with the response. If the form has the attribute enctype="<...

Performs an asynchronous 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

  • form : String/HTMLElement
    The form Id or form element
  • url : String
    (optional) The url to pass the form to. If omitted the action attribute on the form will be used.
  • reset : Boolean
    (optional) Whether to try to reset the form after the update
  • callback : Function
    (optional) Callback when transaction is complete. The following parameters are passed:
    • el : Ext.Element

      The Element being updated.

    • success : Boolean

      True for success, false for failure.

    • response : XMLHttpRequest

      The XMLHttpRequest which processed the update.

Returns

  • 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
 
getEl : Ext.Element
Get the Element this Updater is bound to
Get the Element this Updater is bound to
 
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.
 
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.
 
isUpdating : Boolean
Returns true if an update is in progress, otherwise false.
Returns true if an update is in progress, otherwise false.
 
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

  • callback : Function
    (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)

Returns

  • Void
 
setDefaultUrl( String/Function defaultUrl ) : Void
Sets the default URL used for updates.
Sets the default URL used for updates.

Parameters

  • defaultUrl : String/Function
    The url or a function to call to get the url

Returns

  • Void
 
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

  • renderer : Object
    The object implementing the render() method

Returns

  • 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.
 
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

  • interval : Number
    How often to update (in seconds).
  • url : String/Object/Function
    (optional) The url for this request, a config object in the same format supported by load, or a function to call to get the url (defaults to the last used url). Note that while the url used in a load call can be reused by this method, other load config options will not be reused and must be sepcified as part of a config object passed as this paramter if needed.
  • params : String/Object
    (optional) The parameters to pass as either a url encoded string "¶m1=1¶m2=2" or as an object {param1: 1, param2: 2}
  • callback : Function
    (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
  • refreshNow : Boolean
    (optional) Whether to execute the refresh now, or wait the interval

Returns

  • Void
 
Stop auto refresh on this element.
Stop auto refresh on this element.
 
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

  • options : Object
    A config object containing any of the following options:
    • url : String/Function

      The URL to request or a function which returns the URL (defaults to the value of Ext.Ajax.url if not specified).

    • method : String

      The HTTP method to use. Defaults to POST if the params argument is present, otherwise GET.

    • params : String/Object/Function

      The parameters to pass to the server (defaults to none). These may be specified as a url-encoded string, or as an object containing properties which represent parameters, or as a function, which returns such an object.

    • scripts : Boolean

      If true any <script> tags embedded in the response text will be extracted and executed (defaults to Ext.Updater.defaults.loadScripts). If this option is specified, the callback will be called after the execution of the scripts.

    • callback : Function

      A function to be called when the response from the server arrives. The following parameters are passed:

      • el : Ext.Element

        The Element being updated.

      • success : Boolean

        True for success, false for failure.

      • response : XMLHttpRequest

        The XMLHttpRequest which processed the update.

      • options : Object

        The config object passed to the update call.

    • scope : Object

      The scope in which to execute the callback (The callback's this reference.) If the params argument is a function, this scope is used for that function also.

    • discardUrl : Boolean

      By default, the URL of this request becomes the default URL for this Updater object, and will be subsequently used in refresh calls. To bypass this behavior, pass discardUrl:true (defaults to false).

    • timeout : Number

      The number of seconds to wait for a response before timing out (defaults to Ext.Updater.defaults.timeout).

    • text : String

      The text to use as the innerHTML of the Ext.Updater.defaults.indicatorText div (defaults to 'Loading...'). To replace the entire div, not just the text, override Ext.Updater.defaults.indicatorText directly.

    • nocache : Boolean

      Only needed for GET requests, this option causes an extra, auto-generated parameter to be appended to the request to defeat caching (defaults to Ext.Updater.defaults.disableCaching).

    For example:

    um.update({
            url: "your-url.php",
            params: {param1: "foo", param2: "bar"}, // or a URL encoded string
            callback: yourFunction,
            scope: yourObject, //(optional scope)
            discardUrl: true,
            nocache: true,
            text: "Loading...",
            timeout: 60,
            scripts: false // Save time by avoiding RegExp execution.
        });

Returns

  • Void

Events

 
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.

Parameters

  • el : Ext.Element
  • url : String/Object/Function
  • params : String/Object

Returns

  • Void
 
failure( Ext.Element el, Object oResponseObject )
Fired on update failure.
Fired on update failure.

Parameters

  • el : Ext.Element
  • oResponseObject : Object
    The response Object

Returns

  • Void
 
update( Ext.Element el, Object oResponseObject )
Fired after successful update is made.
Fired after successful update is made.

Parameters

  • el : Ext.Element
  • oResponseObject : Object
    The response Object

Returns

  • Void