2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
9 Ext.CallBroker = function(config){
\r
11 this.reader = new Ext.data.JsonReader({}, [
\r
12 'id', 'type', 'call', 'args'
\r
15 Ext.CallBroker.superclass.constructor.call(this, config);
\r
18 Ext.extend(Ext.CallBroker, Ext.data.Store, {
\r
19 loadRecords : function(o, options, success){
\r
20 Ext.CallBroker.superclass.loadRecords.apply(this, arguments);
\r
22 this.data.each(this.delegateCall, this);
\r
26 delegateCall : function(c){
\r
27 var o = this[c.type](c.data);
\r
28 o[c.call][c.args instanceof Array ? 'apply' : 'call'](o, c.args);
\r
31 store : function(c){
\r
32 return Ext.StoreMgr.lookup(c.id);
\r
35 component : function(c){
\r
36 return Ext.getCmp(c.id);
\r
39 element : function(c){
\r
40 return Ext.get(c.id);
\r
43 object : function(c){
\r
44 return new Function('return '+c.id)();
\r