Class Ext.data.HttpProxy
| Package: | Ext.data |
| Class: | HttpProxy |
| Extends: | Object |
| Defined In: | HttpProxy.js |
An implementation of
Ext.data.DataProxy that reads a data object from an
Ext.data.Connection object
configured to reference a certain URL.
Note that 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 access to remote data, use an Ext.data.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".
Properties
-
Methods
-
Events
Public Properties
This class has no public properties.
Public Methods
| |
HttpProxy( Object conn ) |
HttpProxy |
|
| |
getConnection() : Connection |
HttpProxy |
| Return the Ext.data.Connection object being used by this Proxy. |
| |
load( Object params, Ext.data.DataReader reader, Function callback, Object scope, Object arg ) : void |
HttpProxy |
| Load data from the configured Ext.data.Connection, read the data object into
a block of Ext.data.Records using the pa... |
Public Events
This class has no public events.
Constructor Details
HttpProxy
public function HttpProxy( Object conn )
Parameters:
conn : ObjectConnection config options to add to each request (e.g. {url: 'foo.php'} or
an
Ext.data.Connection object. If a Connection config is passed, the singleton
Ext.Ajax object
will be used to make the request.
Method Details
getConnection
public function getConnection()
This method is defined by HttpProxy.
load
public function load( Object params, Ext.data.DataReader reader, Function callback, Object scope, Object arg )
Load data from the configured
Ext.data.Connection, read the data object into
a block of Ext.data.Records using the passed
Ext.data.DataReader implementation, and
process that block using the passed callback.
Parameters:
params : ObjectAn object containing properties which are to be used as HTTP parameters
for the request to the remote server.
reader : Ext.data.DataReaderThe Reader object which converts the data
object into a block of Ext.data.Records.
callback : FunctionThe function into which to pass the block of Ext.data.Records.
The function must be passed
- The Record block object
- The "arg" argument from the load function
- A boolean success indicator
scope : ObjectThe scope in which to call the callback
arg : ObjectAn optional argument which is passed to the callback as its second parameter.
Returns:
This method is defined by HttpProxy.