public class ScriptTagProxy<C> extends Object implements DataProxy<C,JavaScriptObject>
A DataProxy
that reads a data from a URL which may be in a
domain other than the originating domain of the running page.
Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain of the running page, you must use this class, rather than HttpProxy.
When using a load config object that implements LoadConfig
or
ModelData
, all properties and property values will be sent as
request parameters in the load request.
HttpProxy
Constructor and Description |
---|
ScriptTagProxy(String url)
Creates a script tag proxy that reads data from a URL that may be in a
domain other than the originating domain of the running page.
|
Modifier and Type | Method and Description |
---|---|
protected String |
generateUrl(C loadConfig)
Encodes the load config into a format that can be used for a GET query
string or a POST url-encoded body.
|
DataWriter<C,String> |
getWriter()
Returns the data writer for this proxy.
|
void |
load(C loadConfig,
<any> callback)
Data should be retrieved using the specified load config.
|
void |
setUrl(String url)
Sets the proxy's url.
|
void |
setWriter(DataWriter<C,String> writer)
Sets the data writer for this proxy.
|
public ScriptTagProxy(String url)
url
- the URL representing the data to retrievepublic DataWriter<C,String> getWriter()
public void load(C loadConfig, <any> callback)
DataProxy
DataReader
can be used to "process" the raw data.public void setUrl(String url)
url
- the urlpublic void setWriter(DataWriter<C,String> writer)
writer
- the data writerprotected String generateUrl(C loadConfig)
setWriter(com.sencha.gxt.data.shared.writer.DataWriter<C, java.lang.String>)
to set the data
writer responsible for encoding the load config. If it is not set the load
config is assumed to require no further encoding and its value is retrieved
using Object.toString()
.loadConfig
- the load config to encodeCopyright © 2018. All rights reserved.