Provides AJAX-style update capabilities for Element objects. Updater can be used to
update
an
Ext.Element once, or you can use
startAutoRefresh to set up an auto-updating
Element on a specific interval.
Usage:
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..."
});
updateElement(
Mixed el, String url, [String/Object params], [Object options] ) : Void
Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).
Usage:
Ext.Updater.up...
Static convenience method.
This method is deprecated in favor of el.load({url:'foo.php', ...}).
Usage:
Ext.Updater.updateElement("my-div", "stuff.php");
Parameters
- el : Mixed
The element to update
- url : String
The url
- params : String/Object
(optional) Url encoded param string or an object of name/value pairs
- options : Object
(optional) A config object with any of the Updater properties you want to set - for
example: {disableCaching:true, indicatorText: "Loading data..."}
Returns