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 * @class Ext.direct.RemotingMethod
20 Ext.define('Ext.direct.RemotingMethod', {
22 constructor: function(config){
24 params = Ext.isDefined(config.params) ? config.params : config.len,
27 me.name = config.name;
28 me.formHandler = config.formHandler;
29 if (Ext.isNumber(params)) {
30 // given only the number of parameters
35 * Given an array of either
37 * b) Objects with a name property. We may want to encode extra info in here later
40 Ext.each(params, function(param){
41 name = Ext.isObject(param) ? param.name : param;
48 * Takes the arguments for the Direct function and splits the arguments
49 * from the scope and the callback.
50 * @param {Array} args The arguments passed to the direct call
51 * @return {Object} An object with 3 properties, args, callback & scope.
53 getCallData: function(args){
64 scope = args[len + 1];
66 data = args.slice(0, len);
69 data = Ext.apply({}, args[0]);
73 // filter out any non-existent properties
75 if (data.hasOwnProperty(name)) {
76 if (!Ext.Array.contains(params, name)) {