3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * Small utility class used internally to represent a Direct method.
17 * Thi class is used internally.
18 * @class Ext.direct.RemotingMethod
21 Ext.define('Ext.direct.RemotingMethod', {
23 constructor: function(config){
25 params = Ext.isDefined(config.params) ? config.params : config.len,
28 me.name = config.name;
29 me.formHandler = config.formHandler;
30 if (Ext.isNumber(params)) {
31 // given only the number of parameters
36 * Given an array of either
38 * b) Objects with a name property. We may want to encode extra info in here later
41 Ext.each(params, function(param){
42 name = Ext.isObject(param) ? param.name : param;
49 * Takes the arguments for the Direct function and splits the arguments
50 * from the scope and the callback.
51 * @param {Array} args The arguments passed to the direct call
52 * @return {Object} An object with 3 properties, args, callback & scope.
54 getCallData: function(args){
65 scope = args[len + 1];
67 data = args.slice(0, len);
70 data = Ext.apply({}, args[0]);
74 // filter out any non-existent properties
76 if (data.hasOwnProperty(name)) {
77 if (!Ext.Array.contains(params, name)) {