Clear Up
SharpKit Reference

Direct Class

This class is used to send requests to the server using Ext.Direct. When a request is made, the transport mechanism is handed off to the appropriate Provider to complete the call.

Specifying the function

This proxy expects a Direct remoting method to be passed in order to be able to complete requests. This can be done by specifying the directFn configuration. This will use the same direct method for all requests. Alternatively, you can provide an api configuration. This allows you to specify a different remoting method for each CRUD action.

Parameters

This proxy provides options to help configure which parameters will be sent to the server. By specifying the paramsAsHash option, it will send an object literal containing each of the passed parameters. The paramOrder option can be used to specify the order in which the remoting method parameters are passed.

Example Usage

  
    Ext.define('User', {
            extend: 'Ext.data.Model',
            fields: ['firstName', 'lastName'],
            proxy: {
            type: 'direct',
            directFn: MyApp.getUsers,
            paramOrder: 'id' // Tells the proxy to pass the id as the first parameter to the remoting method.
            }
            });
            User.load(1);
            

Namespace: Ext.data.proxy

Base Interfaces

Constructors

Fields

Name Description
directFn Function to call when executing a request. directFn is a simple alternative to defining the api configuration-parameter for Store's which will not implement a full CRUD api. The directFn may also be a string reference to the fully qualified name of the function, for example: 'MyApp.company.GetProfile'. This can be useful when using dynamic loading. The string will be looked up when the proxy is created.
paramOrder Defaults to undefined. A list of params to be executed server side. Specify the params in the order in which they must be executed on the server-side as either (1) an Array of String values, or (2) a String of params delimited by either whitespace, comma, or pipe. For example, any of the following would be acceptable:
paramOrder: ['param1','param2','param3']
            paramOrder: 'param1 param2 param3'
            paramOrder: 'param1,param2,param3'
            paramOrder: 'param1|param2|param'
            
paramsAsHash Send parameters as a collection of named arguments. Providing a paramOrder nullifies this configuration. Defaults to: true
© Copyright 2005-2011 SharpKit. All rights reserved.