var me = this;
Ext.override(Ext.Component, {
fireEvent: function(ev) {
var me = this;
Ext.override(Ext.Component, {
fireEvent: function(ev) {
var bus = this.bus,
selectors = bus[ev],
selector, controllers, id, events, event, i, ln;
var bus = this.bus,
selectors = bus[ev],
selector, controllers, id, events, event, i, ln;
if (selectors) {
// Loop over all the selectors that are bound to this event
for (selector in selectors) {
// Check if the target matches the selector
if (target.is(selector)) {
if (selectors) {
// Loop over all the selectors that are bound to this event
for (selector in selectors) {
// Check if the target matches the selector
if (target.is(selector)) {
controllers = selectors[selector];
for (id in controllers) {
// Loop over all the events that are bound to this selector on this controller
controllers = selectors[selector];
for (id in controllers) {
// Loop over all the events that are bound to this selector on this controller
Ext.Object.each(selectors, function(selector, listeners) {
Ext.Object.each(listeners, function(ev, listener) {
Ext.Object.each(selectors, function(selector, listeners) {
Ext.Object.each(listeners, function(ev, listener) {
event.addListener(listener, scope, options);
// Create the bus tree if it is not there yet
bus[ev] = bus[ev] || {};
bus[ev][selector] = bus[ev][selector] || {};
event.addListener(listener, scope, options);
// Create the bus tree if it is not there yet
bus[ev] = bus[ev] || {};
bus[ev][selector] = bus[ev][selector] || {};