X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..92c2b89db26be16707f4a805d3303ab2531006e1:/docs/output/Ext.util.Observable.html?ds=sidebyside diff --git a/docs/output/Ext.util.Observable.html b/docs/output/Ext.util.Observable.html index 4e79f92b..b4c5cac8 100644 --- a/docs/output/Ext.util.Observable.html +++ b/docs/output/Ext.util.Observable.html @@ -1,4 +1,4 @@ -
Package: | Ext.util |
Defined In: | Observable.js, Observable-more.js |
Class: | Observable |
Subclasses: | Component, Direct, History, ListView.ColumnResizer, ListView.Sorter, Resizable, SplitBar, Updater, Connection, DataProxy, Node, Store, Tree, DragTracker, Provider, BasicForm, AbstractSelectionModel, ColumnModel, GridView, PropertyStore, DefaultSelectionModel, MultiSelectionModel, TreeLoader, ClickRepeater, MixedCollection |
Extends: | Object |
Package: | Ext.util |
Defined In: | Observable-more.js, Observable.js |
Class: | Observable |
Subclasses: | Component, Direct, History, Resizable, SplitBar, Updater, Connection, DataProxy, Node, Store, Tree, DragTracker, Provider, BasicForm, AbstractSelectionModel, ColumnModel, GridView, PropertyStore, ColumnResizer, Sorter, DefaultSelectionModel, MultiSelectionModel, TreeLoader, ClickRepeater, MixedCollection |
Extends: | Object |
o
: Observablefn
: Functionscope
: ObjectFunction c
)
+the event will not fire.o
: Observablefn
: Functionscope
: Objectthis
reference) in which the function is executed. Defaults to the Observable firing the event.Function c
, Object listeners
)
:
void@@ -95,12 +95,14 @@ This makes any event fired on any instance of the passed class a...
Usage:
Ext.util.Observable.observeClass(Ext.data.Connection);
Ext.data.Connection.on('beforerequest', function(con, options) {
- console.log("Ajax request made to " + options.url);
-});
c
: FunctionObservable o
)
+ console.log('Ajax request made to ' + options.url);
+});c
: Functionlisteners
: ObjectObservable o
)
:
- voido
: ObservableObject object
)
+ voido
: ObservableObject|String o
, string Optional.
)
:
- voidobject
: ObjectString eventName
, Function handler
, [Object scope
], [Object options
] )
+ voido
: Object|Stringtrue
+or the first event name string if multiple event names are being passed as separate parameters.Optional.
: stringthis.addEvents('storeloaded', 'storecleared');
String eventName
, Function handler
, [Object scope
], [Object options
] )
:
voideventName
: Stringhandler
: Functionscope
: Objectthis
reference) in which the handler function is executed.
If omitted, defaults to the object which fired the event.options
: ObjectmyDataView.on('click', this.onClick, this, {
- single: true,
- delay: 100
+single: true,
+delay: 100
});
Attaching multiple handlers in 1 call
@@ -130,30 +132,62 @@ The method also allows for a single argument to be passed which is a config obje
which specify multiple handlers.
myGridPanel.on({
- 'click' : {
- fn: this.onClick,
- scope: this,
- delay: 100
- },
- 'mouseover' : {
- fn: this.onMouseOver,
- scope: this
- },
- 'mouseout' : {
- fn: this.onMouseOut,
- scope: this
- }
+'click' : {
+ fn: this.onClick,
+ scope: this,
+ delay: 100
+},
+'mouseover' : {
+ fn: this.onMouseOver,
+ scope: this
+},
+'mouseout' : {
+ fn: this.onMouseOut,
+ scope: this
+}
});
Or a shorthand syntax:
myGridPanel.on({
- 'click' : this.onClick,
- 'mouseover' : this.onMouseOver,
- 'mouseout' : this.onMouseOut,
- scope: this
-});
Object events
)
+'click' : this.onClick,
+'mouseover' : this.onMouseOver,
+'mouseout' : this.onMouseOut,
+ scope: this
+});Returns:String/Array events
)
:
- voidevents
: ObjectString eventName
, Object... args
)
+ voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
+this.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 +implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to +access the required target more quickly.
+Example:
Ext.override(Ext.form.Field, {
+ // Add functionality to Field's initComponent to enable the change event to bubble
+ initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
+ this.enableBubble('change');
+ }),
+
+ // We know that we want Field's events to bubble directly to the FormPanel.
+ getBubbleTarget : function() {
+ if (!this.formPanel) {
+ this.formPanel = this.findParentByType('form');
+ }
+ return this.formPanel;
+ }
+});
+
+var myForm = new Ext.formPanel({
+ title: 'User Details',
+ items: [{
+ ...
+ }],
+ listeners: {
+ change: function() {
+ // Title goes red if form has been modified.
+ myForm.header.setStyle('color', 'red');
+ }
+ }
+});
events
: String/ArrayString eventName
, Object... args
)
:
BooleanFires the specified event with the passed parameters (minus the event name).