Class Ext.util.Observable

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
Base class that provides a common interface for publishing events. Subclasses are expected to to have a property "events" with all the events defined, and, optionally, a property "listeners" with configured listeners defined.
For example:
Employee = Ext.extend(Ext.util.Observable, {
    constructor: function(config){
        this.name = config.name;
        this.addEvents({
            "fired" : true,
            "quit" : true
        });

        // Copy configured listeners into *this* object so that the base class's
        // constructor will add them.
        this.listeners = config.listeners;

        // Call our superclass constructor to complete construction process.
        Employee.superclass.constructor.call(config)
    }
});
This could then be used like this:
var newEmployee = new Employee({
    name: employeeName,
    listeners: {
        quit: function() {
            // By default, "this" will be the object that fired the event.
            alert(this.name + " has quit!");
        }
    }
});

Config Options

Config OptionsDefined By

Public Properties

This class has no public properties.

Public Methods

MethodDefined By

Public Events

This class has no public events.