Clear Up
SharpKit Reference

Server Class

Namespace: Ext.data.proxy

Base Types

System.Object

Constructors

Name Description
Server()
Server(ServerConfig)
Server(object) @cfg {Object} 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 {@link #api} property, or if undefined default to the configured {@link Ext.data.Store}.{@link Ext.data.proxy.Server#url 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 {@link Ext.data.proxy.Server#url url}.

Properties

Name Description
alias @author Ed Spencer * ServerProxy is a superclass of {@link Ext.data.proxy.JsonP JsonPProxy} and {@link Ext.data.proxy.Ajax 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).
alternateClassName
cacheString @cfg {String} cacheString The name of the cache param added to the url when using noCache. Defaults to "_dc".
directionParam @cfg {String} 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'.
extend @author Ed Spencer * ServerProxy is a superclass of {@link Ext.data.proxy.JsonP JsonPProxy} and {@link Ext.data.proxy.Ajax 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).
filterParam @cfg {String} 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.
groupParam @cfg {String} 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.
limitParam @cfg {String} 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.
noCache @cfg {Boolean} noCache Disable caching by adding a unique parameter name to the request. Set to false to allow caching. Defaults to true.
pageParam @cfg {String} 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.
simpleSortMode @cfg {Boolean} 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'.
sortParam @cfg {String} 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.
startParam @cfg {String} 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.
timeout @cfg {Number} timeout The number of milliseconds to wait for a response. Defaults to 30000 milliseconds (30 seconds).

Methods

Name Description
applyEncoding(JsArray) Encode any values being sent to the server. Can be overridden in subclasses. @private @param {Array} An array of sorters/filters. @return {Object} The encoded value
buildRequest(Operation) Creates and returns an Ext.data.Request object based on the options passed by the {@link Ext.data.Store Store} that this Proxy is attached to. @param {Ext.data.Operation} operation The {@link Ext.data.Operation Operation} object to execute @return {Ext.data.Request} The request object
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. @param {Ext.data.Request} request The request object @return {String} The url
create()
destroy()
doRequest(Operation, JsAction, object) In ServerProxy subclasses, the {@link #create}, {@link #read}, {@link #update} and {@link #destroy} methods all pass through to doRequest. Each ServerProxy subclass must implement the doRequest method - see {@link Ext.data.proxy.JsonP} and {@link Ext.data.proxy.Ajax} for examples. This method carries the same signature as each of the methods that delegate to it. * @param {Ext.data.Operation} operation The Ext.data.Operation object @param {Function} callback The callback function to call when the Operation has completed @param {Object} scope The scope in which to execute the callback
encodeFilters(object) Encodes the array of {@link Ext.util.Filter} objects into a string to be sent in the request url. By default, this simply JSON-encodes the filter data @param {Ext.util.Filter[]} filters The array of {@link Ext.util.Filter Filter} objects @return {String} The encoded filters
encodeSorters(object) Encodes the array of {@link Ext.util.Sorter} objects into a string to be sent in the request url. By default, this simply JSON-encodes the sorter data @param {Ext.util.Sorter[]} sorters The array of {@link Ext.util.Sorter Sorter} objects @return {String} The encoded sorters
extractResponseData(object) Template method to allow subclasses to specify how to get the response for the reader. @private @param {Object} response The server response @return {Object} The response data to be used by the reader
getParams(object) @private Copy any sorters, filters etc into the params so they can be sent over the wire
getUrl(Request) Get the url for the request taking into account the order of priority, - The request - The api - The url @private @param {Ext.data.Request} request The request @return {String} The url
onDestroy() Optional callback function which can be used to clean up after a request has been completed. @param {Ext.data.Request} request The Request object @param {Boolean} success True if the request was successful @method
processResponse(object, object, object, object, object, object)
read()
setException(Operation, object) Sets up an exception on the operation @private @param {Ext.data.Operation} operation The operation @param {Object} response The response
setExtraParam(JsString, object) Sets a value in the underlying {@link #extraParams}. @param {String} name The key for the new value @param {Object} value The value
update()
© Copyright 2005-2011 SharpKit. All rights reserved.