Apr 04, 2013, 8:47 PM
Unfortunately, this will work only on page_load events. For any DirectEvent it would not recognise the ID.
Ext.net.ComponentManager.registerId = function (cmp) {
if (cmp.initDirectEvents) {
cmp.initDirectEvents();
}
if (cmp.initialConfig || cmp.isStore || cmp.proxyId) {
var cfg = cmp.initialConfig || {},
id = cmp.isStore ? cmp.storeId : (cmp.proxyId || cfg.proxyId || cfg.id),
ns = cmp.ns || (Ext.isArray(Ext.net.ResourceMgr.ns) ? Ext.net.ResourceMgr.ns[0] : Ext.net.ResourceMgr.ns),
hasId = (!Ext.isEmpty(id, false) && id.indexOf("ext-comp-") !== 0);
if (cmp.forbidIdScoping !== true && ( hasId || (cmp.ns && !Ext.isEmpty(cmp.itemId, false)) ) ) {
if (ns) {
(Ext.isObject(ns) ? ns : Ext.ns(ns))[hasId ? id : cfg.itemId] = cmp;
cmp.nsId = (Ext.isObject(ns) ? "" : (ns + ".")) + (hasId ? id : cfg.itemId);
} else {
window[id] = cmp;
cmp.nsId = id;
}
}
}
};
Ext.net.ComponentManager.registerId = function (cmp) {
if (cmp.initDirectEvents) {
cmp.initDirectEvents();
}
if (cmp.initialConfig || cmp.isStore || cmp.proxyId) {
var cfg = cmp.initialConfig || {},
id = cmp.isStore ? cmp.storeId : (cmp.proxyId || cfg.proxyId || cfg.id),
ns = cmp.ns || (Ext.isArray(Ext.net.ResourceMgr.ns) ? Ext.net.ResourceMgr.ns[0] : Ext.net.ResourceMgr.ns),
hasId = (!Ext.isEmpty(id, false) && id.indexOf("ext-comp-") !== 0);
if (cmp.forbidIdScoping !== true && ( hasId || (cmp.ns && !Ext.isEmpty(cmp.itemId, false)) ) ) {
if (ns) {
(Ext.isObject(ns) ? ns : Ext.ns(ns))[hasId ? id : cfg.itemId] = cmp;
cmp.nsId = (Ext.isObject(ns) ? "" : (ns + ".")) + (hasId ? id : cfg.itemId);
} else {
window[id] = cmp;
cmp.nsId = id;
}
}
}
};