Clear Up
SharpKit Reference

Server Class

NOTE This is a private utility class for internal use by the framework. Don't rely on its existence.

ServerProxy is a superclass of JsonPProxy and AjaxProxy, and would not usually be used directly.

ServerProxy should ideally be named HttpProxy as it is a superclass for all HTTP proxies - for Ext JS 4.x it has been called ServerProxy to enable any 3.x applications that reference the HttpProxy to continue to work (HttpProxy is now an alias of AjaxProxy).

Namespace: Ext.data.proxy

Base Interfaces

Constructors

Methods

Name Description
afterRequest(Request, bool) Optional callback function which can be used to clean up after a request has been completed.

This is a template method. a hook into the functionality of this class. Feel free to override it in child classes.

buildRequest(Operation) Creates an Request object from Operation. This gets called from doRequest methods in subclasses of Server proxy.
buildUrl(Request) Generates a url based on a given Ext.data.Request object. By default, ServerProxy's buildUrl will add the cache-buster param to the end of the url. Subclasses may need to perform additional modifications to the url.
doRequest(Operation, Delegate, object) In ServerProxy subclasses, the create, read, update and destroy methods all pass through to doRequest. Each ServerProxy subclass must implement the doRequest method - see Ext.data.proxy.JsonP and Ext.data.proxy.Ajax for examples. This method carries the same signature as each of the methods that delegate to it.
encodeFilters(JsArray<T>) Encodes the array of Ext.util.Filter objects into a string to be sent in the request url. By default, this simply JSON-encodes the filter data
encodeSorters(JsArray<T>) Encodes the array of Ext.util.Sorter objects into a string to be sent in the request url. By default, this simply JSON-encodes the sorter data
extractResponseData(object) Template method to allow subclasses to specify how to get the response for the reader.

This is a template method. a hook into the functionality of this class. Feel free to override it in child classes.

setExtraParam(JsString, object) Sets a value in the underlying extraParams.

Fields

Name Description
api Specific urls to call on CRUD action methods "create", "read", "update" and "destroy". Defaults to:
api: {
            create  : undefined,
            read    : undefined,
            update  : undefined,
            destroy : undefined
            }
            
The url is built based upon the action being executed [create|read|update|destroy] using the commensurate api property, or if undefined default to the configured Ext.data.Store.url. For example:
api: {
            create  : '/controller/new',
            read    : '/controller/load',
            update  : '/controller/update',
            destroy : '/controller/destroy_action'
            }
            
If the specific URL for a given CRUD action is undefined, the CRUD action request will be directed to the configured url.
cacheString The name of the cache param added to the url when using noCache. Defaults to "_dc". Defaults to: "_dc"
directionParam The name of the direction parameter to send in a request. This is only used when simpleSortMode is set to true. Defaults to 'dir'. Defaults to: "dir"
extraParams Extra parameters that will be included on every request. Individual requests with params of the same name will override these params when they are in conflict.
filterParam The name of the 'filter' parameter to send in a request. Defaults to 'filter'. Set this to undefined if you don't want to send a filter parameter. Defaults to: "filter"
groupDirectionParam The name of the direction parameter to send in a request. This is only used when simpleGroupMode is set to true. Defaults to 'groupDir'. Defaults to: "groupDir"
groupParam The name of the 'group' parameter to send in a request. Defaults to 'group'. Set this to undefined if you don't want to send a group parameter. Defaults to: "group"
limitParam The name of the 'limit' parameter to send in a request. Defaults to 'limit'. Set this to undefined if you don't want to send a limit parameter. Defaults to: "limit"
noCache Disable caching by adding a unique parameter name to the request. Set to false to allow caching. Defaults to true. Defaults to: true
pageParam The name of the 'page' parameter to send in a request. Defaults to 'page'. Set this to undefined if you don't want to send a page parameter. Defaults to: "page"
simpleGroupMode Enabling simpleGroupMode in conjunction with remoteGroup will only send one group property and a direction when a remote group is requested. The groupDirectionParam and groupParam will be sent with the property name and either 'ASC' or 'DESC'. Defaults to: false
simpleSortMode Enabling simpleSortMode in conjunction with remoteSort will only send one sort property and a direction when a remote sort is requested. The directionParam and sortParam will be sent with the property name and either 'ASC' or 'DESC'. Defaults to: false
sortParam The name of the 'sort' parameter to send in a request. Defaults to 'sort'. Set this to undefined if you don't want to send a sort parameter. Defaults to: "sort"
startParam The name of the 'start' parameter to send in a request. Defaults to 'start'. Set this to undefined if you don't want to send a start parameter. Defaults to: "start"
timeout The number of milliseconds to wait for a response. Defaults to 30000 milliseconds (30 seconds). Defaults to: 30000
url The URL from which to request the data object.
© Copyright 2005-2011 SharpKit. All rights reserved.