View Full Version : [CLOSED]Ext.util.Observable.listeners documentation is confusing

17 Mar 2011, 10:58 AM
The example given for "listeners" isn't very helpful. First, the listener added refers to the undocumented 'el' property:

click: {
element: 'el', //bind to the underlying el property on the panel
fn: function(){ console.log('click el'); }

Second, it does not specify that a simple syntax for component events is available. An example such as the following would help:

listeners: { render: function () { console.log('in render'); } }

Finally, the documentation does not describe the options shown ("element" and "fn"). It refers to documentation elsewhere which does not directly show the config options, and itself refers to yet another piece of documentation (that's 3 degrees of separation).

If this documentation just showed the two possible forms and said "the second form can use any config options available when adding an individual listener" it would be clearer.


20 Mar 2011, 5:11 PM
The docs say to see the addListener method, which contains all the detailed information about binding events.