Observable Proxy ServerProxy AjaxProxy
Package: | Ext.data |
Defined In: | AjaxProxy.js |
Class: | AjaxProxy |
Subclasses: | RestProxy |
Extends: | ServerProxy |
An implementation of Ext.data.Proxy that processes data requests within the same domain of the originating page.
Note: this class cannot be used to retrieve data from a domain other than the domain from which the running page was served. For cross-domain requests, use a ScriptTagProxy.
Be aware that to enable the browser to parse an XML document, the server must set the Content-Type header in the HTTP response to "text/xml".
Config Options | Defined By | |
---|---|---|
batchOrder : String Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. Override this
to set a different ord... Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. Override this
to set a different order for the batched CRUD actions to be executed in. Defaults to 'create,update,destroy' | Proxy | |
cacheString : String The name of the cache param added to the url when using noCache (defaults to "_dc") | ServerProxy | |
defaultReaderType : String The default registered reader type. Defaults to 'json' | Proxy | |
defaultWriterType : String The default registered writer type. Defaults to 'json' | Proxy | |
extraParams : Object Extra parameters that will be included on every request. Individual requests with params
of the same name will overri... 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. | ServerProxy | |
headers : Object Any headers to add to the Ajax request. Defaults to undefined. | AjaxProxy | |
listeners : Object A config object containing one or more event handlers to be added to this
object during initialization. This should ... A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the addListener example for attaching multiple handlers at once. DOM events from ExtJs Components While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
is usually only done when extra value can be added. For example the DataView's
| Observable | |
noCache : Boolean Defaults to true. Disable caching by adding a unique parameter
name to the request. | ServerProxy | |
timeout : Number The number of milliseconds to wait for a response. Defaults to 30 seconds. | ServerProxy | |
url : String The URL from which to request the data object. | ServerProxy |
Property | Defined By | |
---|---|---|
actionMethods : Object Mapping of action name to HTTP request method. In the basic AjaxProxy these are set to 'GET' for 'read' actions and '... Mapping of action name to HTTP request method. In the basic AjaxProxy these are set to 'GET' for 'read' actions and 'POST'
for 'create', 'update' and 'destroy' actions. The Ext.data.RestProxy maps these to the correct RESTful methods. | AjaxProxy |
Method | Defined By | |
---|---|---|
AjaxProxy()
Note that if this HttpProxy is being used by a Store, then the
Store's call to load will override any specified callb... Note that if this HttpProxy is being used by a Store, then the Store's call to load will override any specified callback and params options. In this case, use the Store's events to modify parameters, or react to loading events. The Store's baseParams may also be used to pass parameters known at instantiation time. If an options parameter is passed, the singleton Ext.Ajax object will be used to make the request. Parameters:
| AjaxProxy | |
addEvents( Object|String o , string Optional. )
:
voidAdds the specified events to the list of events which this Observable may fire. Adds the specified events to the list of events which this Observable may fire. Parameters:
| Observable | |
addListener( String eventName , Function handler , [Object scope ], [Object options ] )
:
voidAppends an event handler to this object. Appends an event handler to this object. Parameters:
| Observable | |
addManagedListener( Observable|Element item , Object|String ename , Function fn , Object scope , Object opt )
:
voidAdds listeners to any Observable object (or Element) which are automatically removed when this Component
is destroyed... Adds listeners to any Observable object (or Element) which are automatically removed when this Component is destroyed. Parameters:
| Observable | |
afterRequest( Ext.data.Request request , Boolean success )
:
voidOptional callback function which can be used to clean up after a request has been completed. Optional callback function which can be used to clean up after a request has been completed. Parameters:
| ServerProxy | |
batch( Object operations , Object listeners )
:
Ext.data.BatchPerforms a batch of Operations, in the order specified by batchOrder. Used internally by
Ext.data.Store's sync method... Performs a batch of Operations, in the order specified by batchOrder. Used internally by
Ext.data.Store's sync method. Example usage:
Where the myModel* above are Model instances - in this case 1 and 2 are new instances and have not been
saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.Parameters:
| Proxy | |
buildRequest( Ext.data.Operation operation )
:
Ext.data.RequestCreates and returns an Ext.data.Request object based on the options passed by the Store
that this Proxy is attached t... | ServerProxy | |
buildUrl( Ext.data.Request request )
:
StringGenerates a url based on a given Ext.data.Request object. By default, ServerProxy's buildUrl will
add the cache-buste... 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. Parameters:
| ServerProxy | |
clearListeners()
:
void Removes all listeners for this object including the managed listeners Removes all listeners for this object including the managed listeners Parameters:
| Observable | |
clearManagedListeners()
:
void Removes all managed listeners for this object. Removes all managed listeners for this object. Parameters:
| Observable | |
create( Ext.data.Operation operation , Function callback , Object scope )
:
voidPerforms the given create operation. Performs the given create operation. Parameters:
| Proxy | |
destroy( Ext.data.Operation operation , Function callback , Object scope )
:
voidPerforms the given destroy operation. Performs the given destroy operation. Parameters:
| Proxy | |
doRequest( Ext.data.Operation operation , Function callback , Object scope )
:
voidIn ServerProxy subclasses, the create, read, update and destroy methods all pass
through to doRequest. Each ServerPro... 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.ScriptTagProxy
and Ext.data.AjaxProxy for examples. This method carries the same signature as each of the methods that delegate to it. Parameters:
| ServerProxy | |
enableBubble( String/Array events )
:
voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
this.getBubbleTarget() if present.... Enables events fired by this Observable to bubble up an owner hierarchy by calling
This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly. Example:
Parameters:
| Observable | |
fireEvent( String eventName , Object... args )
:
BooleanFires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse... Fires the specified event with the passed parameters (minus the event name). An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget) by calling enableBubble. Parameters:
| Observable | |
getMethod( Ext.data.Request request )
:
StringReturns the HTTP method name for a given request. By default this returns based on a lookup on actionMethods. Returns the HTTP method name for a given request. By default this returns based on a lookup on actionMethods. Parameters:
| AjaxProxy | |
getModel()
:
Ext.data.Model Returns the model attached to this Proxy Returns the model attached to this Proxy Parameters:
| Proxy | |
getReader()
:
Ext.data.Reader Returns the reader currently attached to this proxy instance Returns the reader currently attached to this proxy instance Parameters:
| Proxy | |
getWriter()
:
Ext.data.Writer Returns the writer currently attached to this proxy instance Returns the writer currently attached to this proxy instance Parameters:
| Proxy | |
hasListener( String eventName )
:
BooleanChecks to see if this object has any listeners for a specified event Checks to see if this object has any listeners for a specified event Parameters:
| Observable | |
on( String eventName , Function handler , [Object scope ], [Object options ] )
:
voidAppends an event handler to this object (shorthand for addListener.) Appends an event handler to this object (shorthand for addListener.) Parameters:
| Observable | |
read( Ext.data.Operation operation , Function callback , Object scope )
:
voidPerforms the given read operation. Performs the given read operation. Parameters:
| Proxy | |
relayEvents( Object o , Array events )
:
voidRelays selected events from the specified Observable as if the events were fired by this. Relays selected events from the specified Observable as if the events were fired by this. Parameters:
| Observable | |
removeListener( String eventName , Function handler , [Object scope ] )
:
voidRemoves an event handler. Removes an event handler. Parameters:
| Observable | |
removeManagedListener( Observable|Element item , Object|String ename , Function fn , Object scope )
:
voidRemoves listeners that were added by the mon method. Removes listeners that were added by the mon method. Parameters:
| Observable | |
resumeEvents()
:
void Resume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
event... Resume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
events fired during event suspension will be sent to any listeners now. Parameters:
| Observable | |
setModel( String|Ext.data.Model model , Boolean setOnStore )
:
voidSets the model associated with this proxy. This will only usually be called by a Store Sets the model associated with this proxy. This will only usually be called by a Store Parameters:
| Proxy | |
setReader( String|Object|Ext.data.Reader reader )
:
Ext.data.ReaderSets the Proxy's Reader by string, config object or Reader instance Sets the Proxy's Reader by string, config object or Reader instance Parameters:
| Proxy | |
setWriter( String|Object|Ext.data.Writer writer )
:
Ext.data.WriterSets the Proxy's Writer by string, config object or Writer instance Sets the Proxy's Writer by string, config object or Writer instance Parameters:
| Proxy | |
suspendEvents( Boolean queueSuspended )
:
voidSuspend the firing of all events. (see resumeEvents) Suspend the firing of all events. (see resumeEvents) Parameters:
| Observable | |
un( String eventName , Function handler , [Object scope ] )
:
voidRemoves an event handler (shorthand for removeListener.) Removes an event handler (shorthand for removeListener.) Parameters:
| Observable | |
update( Ext.data.Operation operation , Function callback , Object scope )
:
voidPerforms the given update operation. Performs the given update operation. Parameters:
| Proxy |
Event | Defined By | |
---|---|---|
exception :
( Ext.data.Proxy this , Object response , Ext.data.Operation operation )
Fires when the server returns an exception Fires when the server returns an exception Listeners will be called with the following arguments:
| AjaxProxy |