PDA

View Full Version : Retrieve a Component by css and attach event to it??



shreeketh
10 Jan 2011, 1:48 PM
Ext.getCmp("zzzz").on("afterlayout", function); // this is using id

Below code will gives me the dom element using css class. Someone plz tell me how to attach events to this???
should work like above.
var abcd = function () {
var _d = Ext.query('.zzzz'); // this is using css class.
if (_d.length > 0) {
return _d[0];
}

return null;

} ();

mitchellsimoens
10 Jan 2011, 3:49 PM
_d.on("event", function);