/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ Ext.data.JsonP.Ext_Updater({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.util.Observable","uses":[],"html":"
Hierarchy
Ext.util.ObservableExt.UpdaterFiles
Provides AJAX-style update capabilities for Element objects. Updater can be used to update\nan Ext.Element once, or you can use startAutoRefresh to set up an auto-updating\nElement on a specific interval.
\nUsage:
var el = Ext.get(\"foo\"); // Get Ext.Element object\nvar mgr = el.getUpdater();\nmgr.update({\n url: \"http://myserver.com/index.php\",\n params: {\n param1: \"foo\",\n param2: \"bar\"\n }\n});\n...\nmgr.formUpdate(\"myFormId\", \"http://myserver.com/index.php\");\n
\n// or directly (returns the same Updater instance)\nvar mgr = new Ext.Updater(\"myElementId\");\nmgr.startAutoRefresh(60, \"http://myserver.com/index.php\");\nmgr.on(\"update\", myFcnNeedsToKnow);\n
\n// short handed call directly from the element object\nExt.get(\"foo\").load({\n url: \"bar.php\",\n scripts: true,\n params: \"param1=foo¶m2=bar\",\n text: \"Loading Foo...\"\n});\n
\n\n(optional)
A config object containing one or more event handlers to be added to this\nobject during initialization. This should be a valid listeners config object as specified in the\naddListener example for attaching multiple handlers at once.
\n\nDOM events from ExtJs Components
\n\n\nWhile some ExtJs Component classes export selected DOM events (e.g. \"click\", \"mouseover\" etc), this\n\n\n
is usually only done when extra value can be added. For example the DataView's\nclick
event passing the node clicked on. To access DOM\nevents directly from a Component's HTMLElement, listeners must be added to the Element after the Component\nhas been rendered. A plugin can simplify this step:
// Plugin is configured with a listeners config object.\n// The Component is appended to the argument list of all handler functions.\nExt.DomObserver = Ext.extend(Object, {\n constructor: function(config) {\n this.listeners = config.listeners ? config.listeners : config;\n },\n\n // Component passes itself into plugin's init method\n init: function(c) {\n var p, l = this.listeners;\n for (p in l) {\n if (Ext.isFunction(l[p])) {\n l[p] = this.createHandler(l[p], c);\n } else {\n l[p].fn = this.createHandler(l[p].fn, c);\n }\n }\n\n // Add the listeners to the Element immediately following the render call\n c.render = c.render.createSequence(function() {\n var e = c.getEl();\n if (e) {\n e.on(l);\n }\n });\n },\n\n createHandler: function(fn, c) {\n return function(e) {\n fn.call(this, e, c);\n };\n }\n});\n\nvar combo = new Ext.form.ComboBox({\n\n // Collapse combo when its element is clicked on\n plugins: [ new Ext.DomObserver({\n click: function(evt, comp) {\n comp.collapse();\n }\n })],\n store: myStore,\n typeAhead: true,\n mode: 'local',\n triggerAction: 'all'\n});\n
\n\n\n\nCached url to use for refreshes. Overwritten every time update() is called unless \"discardUrl\" param is set to true.
\nWhether to append unique parameter on get request to disable caching (defaults to Ext.Updater.defaults.disableCaching).
\nWhether to append unique parameter on get request to disable caching (defaults to Ext.Updater.defaults.disableCaching).
\nDelegate for formUpdate() prebound to \"this\", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments
\nText for loading indicator (defaults to Ext.Updater.defaults.indicatorText).
\nText for loading indicator (defaults to Ext.Updater.defaults.indicatorText).
\nTrue to process scripts in the output (defaults to Ext.Updater.defaults.loadScripts).
\nTrue to process scripts in the output (defaults to Ext.Updater.defaults.loadScripts).
\nDelegate for refresh() prebound to \"this\", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments
\nDelegate for refresh() prebound to \"this\", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments
\nThe renderer for this Updater (defaults to Ext.Updater.BasicRenderer).
\nThe renderer for this Updater (defaults to Ext.Updater.BasicRenderer).
\nWhether to show indicatorText when loading (defaults to Ext.Updater.defaults.showLoadIndicator).
\nWhether to show indicatorText when loading (defaults to Ext.Updater.defaults.showLoadIndicator).
\nBlank page URL to use with SSL file uploads (defaults to Ext.Updater.defaults.sslBlankUrl).
\nBlank page URL to use with SSL file uploads (defaults to Ext.Updater.defaults.sslBlankUrl).
\nTimeout for requests or form posts in seconds (defaults to Ext.Updater.defaults.timeout).
\nTimeout for requests or form posts in seconds (defaults to Ext.Updater.defaults.timeout).
\nTransaction object of the current executing transaction, or null if there is no active transaction.
\nTransaction object of the current executing transaction, or null if there is no active transaction.
\nCreate new Updater directly.
\nThe element to update
\nBy default the constructor checks to see if the passed element already\nhas an Updater and if it does it returns the same instance. This will skip that check (useful for extending this class).
\nAborts the currently executing transaction, if any.
\nAdds the specified events to the list of events which this Observable may fire.
\nEither an object with event names as properties with a value of true
\nor the first event name string if multiple event names are being passed as separate parameters.
. Event name if multiple event names are being passed as separate parameters.\nUsage:
\n\nthis.addEvents('storeloaded', 'storecleared');\n
\n\nAppends an event handler to this object.
\nThe name of the event to listen for.
\nThe method the event invokes.
\nThe scope (this
reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.
An object containing handler configuration.\nproperties. This may contain any of the following properties:
this
reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.\nCombining Options
\nUsing the options argument, it is possible to combine different types of listeners:
\n
\nA delayed, one-time listener.\n
myDataView.on('click', this.onClick, this, {\nsingle: true,\ndelay: 100\n});
\n\nAttaching multiple handlers in 1 call
\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n
\n
myGridPanel.on({\n'click' : {\n fn: this.onClick,\n scope: this,\n delay: 100\n},\n'mouseover' : {\n fn: this.onMouseOver,\n scope: this\n},\n'mouseout' : {\n fn: this.onMouseOut,\n scope: this\n}\n});
\n\nOr a shorthand syntax:
\n
myGridPanel.on({\n'click' : this.onClick,\n'mouseover' : this.onMouseOver,\n'mouseout' : this.onMouseOut,\n scope: this\n});
\n\nEnables events fired by this Observable to bubble up an owner hierarchy by calling\nthis.getBubbleTarget()
if present. There is no implementation in the Observable base class.
This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default\nimplementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to\naccess the required target more quickly.
\n\n\nExample:
\n\n\nExt.override(Ext.form.Field, {\n // Add functionality to Field's initComponent to enable the change event to bubble\n initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {\n this.enableBubble('change');\n }),\n\n // We know that we want Field's events to bubble directly to the FormPanel.\n getBubbleTarget : function() {\n if (!this.formPanel) {\n this.formPanel = this.findParentByType('form');\n }\n return this.formPanel;\n }\n});\n\nvar myForm = new Ext.formPanel({\n title: 'User Details',\n items: [{\n ...\n }],\n listeners: {\n change: function() {\n // Title goes red if form has been modified.\n myForm.header.setStyle('color', 'red');\n }\n }\n});\n
\n\nFires the specified event with the passed parameters (minus the event name).
\n\n\nAn event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget)\nby calling enableBubble.
\n\nThe name of the event to fire.
\nVariable number of parameters are passed to handlers.
\nreturns false if any of the handlers return false otherwise it returns true.
\nPerforms an asynchronous form post, updating this element with the response. If the form has the attribute\nenctype=\"multipart/form-data\", it assumes it's a file upload.\nUses this.sslBlankUrl for SSL file uploads to prevent IE security warning.
\n\n\nFile uploads are not performed using normal \"Ajax\" techniques, that is they are not\nperformed using XMLHttpRequests. Instead the form is submitted in the standard manner with the\nDOM <form>
element temporarily modified to have its\ntarget set to refer\nto a dynamically generated, hidden <iframe>
which is inserted into the document\nbut removed after the return data has been gathered.
Be aware that file upload packets, sent with the content type multipart/form-data\nand some server technologies (notably JEE) may require some custom processing in order to\nretrieve parameter names and parameter values from the packet content.
\n\nThe form Id or form element
\nThe url to pass the form to. If omitted the action attribute on the form will be used.
\nWhether to try to reset the form after the update
\nCallback when transaction is complete. The following\nparameters are passed:
The Element being updated.
True for success, false for failure.
The XMLHttpRequest which processed the update.
This is an overrideable method which returns a reference to a default\nrenderer class if none is specified when creating the Ext.Updater.\nDefaults to Ext.Updater.BasicRenderer
\nReturns the current content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details.
\nChecks to see if this object has any listeners for a specified event
\nThe name of the event to check for
\nTrue if the event is being listened for, else false
\nReturns true if the Updater is currently set to auto refresh its content (see startAutoRefresh), otherwise false.
\nReturns true if an update is in progress, otherwise false.
\nAppends an event handler to this object (shorthand for addListener.)
\nThe type of event to listen for
\nThe method the event invokes
\nThe scope (this
reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.
An object containing handler configuration.
\nRefresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
\nCallback when transaction is complete - called with signature (oElement, bSuccess)
\nRelays selected events from the specified Observable as if the events were fired by this.
\nThe Observable whose events this object is to relay.
\nArray of event names to relay.
\nRemoves an event handler.
\nThe type of event the handler was associated with.
\nThe handler to remove. This must be a reference to the function passed into the addListener call.
\nThe scope originally specified for the handler.
\nResume firing events. (see suspendEvents)\nIf events were suspended using the queueSuspended parameter, then all\nevents fired during event suspension will be sent to any listeners now.
\nSets the content renderer for this Updater. See Ext.Updater.BasicRenderer.render for more details.
\nThe object implementing the render() method
\nDisplay the element's \"loading\" state. By default, the element is updated with indicatorText. This\nmethod may be overridden to perform a custom action while this Updater is actively updating its contents.
\nSet this element to auto refresh. Can be canceled by calling stopAutoRefresh.
\nHow often to update (in seconds).
\nThe url for this request, a config object in the same format\nsupported by load, or a function to call to get the url (defaults to the last used url). Note that while\nthe url used in a load call can be reused by this method, other load config options will not be reused and must be\nsepcified as part of a config object passed as this paramter if needed.
\nThe parameters to pass as either a url encoded string\n\"¶m1=1¶m2=2\" or as an object {param1: 1, param2: 2}
\nCallback when transaction is complete - called with signature (oElement, bSuccess)
\nWhether to execute the refresh now, or wait the interval
\nSuspend the firing of all events. (see resumeEvents)
\nPass as true to queue up suspended events to be fired\nafter the resumeEvents call instead of discarding all suspended events;
\nRemoves an event handler (shorthand for removeListener.)
\nThe type of event the handler was associated with.
\nThe handler to remove. This must be a reference to the function passed into the addListener call.
\nThe scope originally specified for the handler.
\nPerforms an asynchronous request, updating this element with the response.\nIf params are specified it uses POST, otherwise it uses GET.
\nNote: Due to the asynchronous nature of remote server requests, the Element\nwill not have been fully updated when the function returns. To post-process the returned\ndata, use the callback option, or an update
event handler.
A config object containing any of the following options:
The URL to request or a function which\nreturns the URL (defaults to the value of Ext.Ajax.url if not specified).
The HTTP method to\nuse. Defaults to POST if the params
argument is present, otherwise GET.
The\nparameters to pass to the server (defaults to none). These may be specified as a url-encoded\nstring, or as an object containing properties which represent parameters,\nor as a function, which returns such an object.
If true
\nany <script> tags embedded in the response text will be extracted\nand executed (defaults to Ext.Updater.defaults.loadScripts). If this option is specified,\nthe callback will be called after the execution of the scripts.
A function to\nbe called when the response from the server arrives. The following\nparameters are passed:
The Element being updated.
True for success, false for failure.
The XMLHttpRequest which processed the update.
The config object passed to the update call.
The scope in which\nto execute the callback (The callback's this
reference.) If the\nparams
argument is a function, this scope is used for that function also.
By default, the URL of this request becomes\nthe default URL for this Updater object, and will be subsequently used in refresh\ncalls. To bypass this behavior, pass discardUrl:true
(defaults to false).
The number of seconds to wait for a response before\ntiming out (defaults to Ext.Updater.defaults.timeout).
The text to use as the innerHTML of the\nExt.Updater.defaults.indicatorText div (defaults to 'Loading...'). To replace the entire div, not\njust the text, override Ext.Updater.defaults.indicatorText directly.
Only needed for GET\nrequests, this option causes an extra, auto-generated parameter to be appended to the request\nto defeat caching (defaults to Ext.Updater.defaults.disableCaching).
\nFor example:\n \n
um.update({\n url: \"your-url.php\",\n params: {param1: \"foo\", param2: \"bar\"}, // or a URL encoded string\n callback: yourFunction,\n scope: yourObject, //(optional scope)\n discardUrl: true,\n nocache: true,\n text: \"Loading...\",\n timeout: 60,\n scripts: false // Save time by avoiding RegExp execution.\n });\n
\n\nStatic convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).\nUsage:
\n\nExt.Updater.updateElement(\"my-div\", \"stuff.php\");
\n\n This method has been deprecated
\n \n\nThe element to update
\nThe url
\nUrl encoded param string or an object of name/value pairs
\nA config object with any of the Updater properties you want to set - for\nexample: {disableCaching:true, indicatorText: \"Loading data...\"}
\nFired before an update is made, return false from your handler and the update is cancelled.
\nFired after successful update is made.
\nThe response Object
\n