X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/docs/output/Ext.data.HttpProxy.html diff --git a/docs/output/Ext.data.HttpProxy.html b/docs/output/Ext.data.HttpProxy.html index bf3a049a..fd413da9 100644 --- a/docs/output/Ext.data.HttpProxy.html +++ b/docs/output/Ext.data.HttpProxy.html @@ -1,4 +1,4 @@ -
Properties Methods Events Config Options Direct Link
Observable
  DataProxy
    HttpProxy

Class Ext.data.HttpProxy

Package:Ext.data
Defined In:HttpProxy.js
Class:HttpProxy
Extends:DataProxy

An implementation of Ext.data.DataProxy that processes data requests within the same +

Observable
  DataProxy
    HttpProxy

Class Ext.data.HttpProxy

Package:Ext.data
Defined In:HttpProxy.js
Class:HttpProxy
Extends:DataProxy

An implementation of Ext.data.DataProxy 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 @@ -13,6 +13,24 @@ Defaults to:

api: {
     update  : undefined,
     destroy : undefined
 }
+

The url is built based upon the action being executed [load|create|save|destroy] +using the commensurate api property, or if undefined default to the +configured Ext.data.Store.url.


+

For example:

+
api: {
+    load :    '/controller/load',
+    create :  '/controller/new',  // Server MUST return idProperty of new record

+    save :    '/controller/update',
+    destroy : '/controller/destroy_action'
+}
+
+// Alternatively, one can use the object-form to specify each API-action

+api: {
+    load: {url: 'read.php', method: 'GET'},
+    create: 'create.php',
+    destroy: 'destroy.php',
+    save: 'update.php'
+}

If the specific URL for a given CRUD action is undefined, the CRUD action request will be directed to the configured url.


Note: To modify the URL for an action dynamically the appropriate API @@ -29,22 +47,9 @@ myStore.on({ // permanent, applying this URL for all subsequent requests. store.proxy.setUrl('changed1.php', true); - // manually set the private connection URL. - // Warning: Accessing the private URL property should be avoided. - // Use the public method setUrl instead, shown above. - // It should be noted that changing the URL like this will affect - // the URL for just this request. Subsequent requests will use the - // API or URL defined in your initial proxy configuration. - store.proxy.conn.url = 'changed1.php'; - - // proxy URL will be superseded by API (only if proxy created to use ajax): - // It should be noted that proxy API changes are permanent and will - // be used for all subsequent requests. - store.proxy.api.load = 'changed2.php'; - - // However, altering the proxy API should be done using the public - // method setApi instead. - store.proxy.setApi('load', 'changed2.php'); + // Altering the proxy API should be done using the public + // method setApi. + store.proxy.setApi('read', 'changed2.php'); // Or set the entire API with a config-object. // When using the config-object option, you must redefine the entire @@ -58,9 +63,9 @@ myStore.on({ } } }); -

DataProxy doRequest : Function
Abstract method that should be implemented in all subclasses +

DataProxy doRequest : Function
Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. ...
Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. (e.g.: HttpProxy.doRequest, -DirectProxy.doRequest).
DataProxy listeners : Object
A config object containing one or more event handlers to be added to this +DirectProxy.doRequest).
DataProxy 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.

@@ -115,48 +120,53 @@ Ext.DomObserver = Ext.extend(Object, { typeAhead: true, mode: 'local', triggerAction: 'all' -});

Observable restful : Boolean
If set to true, a non-phantom record's -id will be appended to the url (defaults to false). -The url is built based u...

If set to true, a non-phantom record's -id will be appended to the url (defaults to false).


-

The url is built based upon the action being executed [load|create|save|destroy] -using the commensurate api property, or if undefined default to the -configured Ext.data.Store.url.


-

Some MVC (e.g., Ruby on Rails, Merb and Django) support this style of segment based urls -where the segments in the URL follow the Model-View-Controller approach.

someSite.com/controller/action/id
+});

Observable onRead : Function
Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. ...
Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. Callback for read action.
DataProxy onWrite : Function
Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. ...
Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. Callback for create, update and destroy actions.
DataProxy restful : Boolean
Defaults to false. Set to true to operate in a RESTful manner. + Note: this parameter will automatically be set to t...

Defaults to false. Set to true to operate in a RESTful manner.

+

Note: this parameter will automatically be set to true if the +Ext.data.Store it is plugged into is set to restful: true. If the +Store is RESTful, there is no need to set this option on the proxy.

+

RESTful implementations enable the serverside framework to automatically route +actions sent to one url based upon the HTTP method, for example: +

store: new Ext.data.Store({
+    restful: true,
+    proxy: new Ext.data.HttpProxy({url:'/users'}); // all requests sent to /users

+    ...
+)}
+If there is no api specified in the configuration of the proxy, +all requests will be marshalled to a single RESTful url (/users) so the serverside +framework can inspect the HTTP Method and act accordingly: +
+Method   url        action
+POST     /users     create
+GET      /users     read
+PUT      /users/23  update
+DESTROY  /users/23  delete
+

+

If set to true, a non-phantom record's +id will be appended to the url. Some MVC (e.g., Ruby on Rails, +Merb and Django) support segment based urls where the segments in the URL follow the +Model-View-Controller approach:

someSite.com/controller/action/id
Where the segments in the url are typically:
  • The first segment : represents the controller class that should be invoked.
  • The second segment : represents the class function, or method, that should be called.
  • The third segment : represents the ID (a variable typically passed to the method).

-

For example:

-
api: {
-    load :    '/controller/load',
-    create :  '/controller/new',  // Server MUST return idProperty of new record

-    save :    '/controller/update',
-    destroy : '/controller/destroy_action'
-}
-
-// Alternatively, one can use the object-form to specify each API-action

-api: {
-    load: {url: 'read.php', method: 'GET'},
-    create: 'create.php',
-    destroy: 'destroy.php',
-    save: 'update.php'
-}
HttpProxy

Public Properties

PropertyDefined By

Public Properties

PropertyDefined By

Public Methods

MethodDefined By
\ No newline at end of file +
Fires before the request-callback is called +In addition to being fired through the DataProxy instance that raised th...

Fires before the request-callback is called

+

In addition to being fired through the DataProxy instance that raised the event, this event is also fired +through the Ext.data.DataProxy class to allow for centralized processing of write events from all +DataProxies by attaching a listener to the Ext.data.Proxy class itself.

Listeners will be called with the following arguments:
  • this : DataProxy
    The proxy that sent the request
  • action : String
    [Ext.data.Api.actions.create|upate|destroy]
  • data : Object
    The data object extracted from the server-response
  • response : Object
    The decoded response from server
  • rs : Record/Record{}
    The records from Store
  • options : Object
    The callback's options property as passed to the request function
DataProxy
\ No newline at end of file