-<div xmlns:ext="http://www.extjs.com" class="body-wrap"><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.Observable.html" ext:member="" ext:cls="Ext.util.Observable">Observable</a> <img src="resources/elbow-end.gif"><a href="output/Ext.data.DataProxy.html" ext:member="" ext:cls="Ext.data.DataProxy">DataProxy</a> <img src="resources/elbow-end.gif">ScriptTagProxy</pre></div><h1>Class <a href="source/ScriptTagProxy.html#cls-Ext.data.ScriptTagProxy">Ext.data.ScriptTagProxy</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">ScriptTagProxy.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/ScriptTagProxy.html#cls-Ext.data.ScriptTagProxy">ScriptTagProxy</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.data.DataProxy.html" ext:cls="Ext.data.DataProxy" ext:member="">DataProxy</a></td></tr></table><div class="description">An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain\r
-other than the originating domain of the running page.<br>\r
-<p>\r
-<b>Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain\r
-of the running page, you must use this class, rather than HttpProxy.</b><br>\r
-<p>\r
-The content passed back from a server resource requested by a ScriptTagProxy <b>must</b> be executable JavaScript\r
-source code because it is used as the source inside a <script> tag.<br>\r
-<p>\r
-In order for the browser to process the returned data, the server must wrap the data object\r
-with a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy.\r
-Below is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy\r
-depending on whether the callback name was passed:\r
-<p>\r
-<pre><code>boolean scriptTag = false;\r
-String cb = request.getParameter(<em>"callback"</em>);\r
-<b>if</b> (cb != null) {\r
- scriptTag = true;\r
- response.setContentType(<em>"text/javascript"</em>);\r
-} <b>else</b> {\r
- response.setContentType(<em>"application/x-json"</em>);\r
-}\r
-Writer out = response.getWriter();\r
-<b>if</b> (scriptTag) {\r
- out.write(cb + <em>"("</em>);\r
-}\r
-out.print(dataBlock.toJsonString());\r
-<b>if</b> (scriptTag) {\r
- out.write(<em>");"</em>);\r
-}</code></pre>\r
-<p>Below is a PHP example to do the same thing:</p><pre><code>$callback = $_REQUEST[<em>'callback'</em>];\r
-\r
-<i>// Create the output object.\r</i>
-$output = array(<em>'a'</em> => <em>'Apple'</em>, <em>'b'</em> => <em>'Banana'</em>);\r
-\r
-<i>//start output\r</i>
-<b>if</b> ($callback) {\r
- header(<em>'Content-Type: text/javascript'</em>);\r
- echo $callback . <em>'('</em> . json_encode($output) . <em>');'</em>;\r
-} <b>else</b> {\r
- header(<em>'Content-Type: application/x-json'</em>);\r
- echo json_encode($output);\r
-}</code></pre>\r
-<p>Below is the ASP.Net code to do the same thing:</p><pre><code>String jsonString = <em>"{success: true}"</em>;\r
-String cb = Request.Params.Get(<em>"callback"</em>);\r
-String responseString = <em>""</em>;\r
-<b>if</b> (!String.IsNullOrEmpty(cb)) {\r
- responseString = cb + <em>"("</em> + jsonString + <em>")"</em>;\r
-} <b>else</b> {\r
- responseString = jsonString;\r
-}\r
-Response.Write(responseString);</code></pre></div><div class="hr"></div><a id="Ext.data.ScriptTagProxy-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.DataProxy-api"></a><b><a href="source/DataProxy.html#cfg-Ext.data.DataProxy-api">api</a></b> : Object<div class="mdesc"><div class="short">Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".
-Defaults to:api: {
- read ...</div><div class="long">Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".\r
-Defaults to:<pre><code>api: {\r
- read : undefined,\r
- create : undefined,\r
- update : undefined,\r
- destroy : undefined\r
-}</code></pre>\r
-<p>The url is built based upon the action being executed <tt>[load|create|save|destroy]</tt>\r
-using the commensurate <tt><a href="output/Ext.data.DataProxy.html#Ext.data.DataProxy-api" ext:member="api" ext:cls="Ext.data.DataProxy">api</a></tt> property, or if undefined default to the\r
-configured <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Ext.data.Store</a>.<a href="output/Ext.data.Store.html#Ext.data.Store-url" ext:member="url" ext:cls="Ext.data.Store">url</a>.</p><br>\r
-<p>For example:</p>\r
-<pre><code>api: {\r
- load : <em>'/controller/load'</em>,\r
- create : <em>'/controller/<b>new</b>'</em>, <i>// Server MUST <b>return</b> idProperty of <b>new</b> record\r</i>
- save : <em>'/controller/update'</em>,\r
- destroy : <em>'/controller/destroy_action'</em>\r
-}\r
-\r
-<i>// Alternatively, one can use the object-form to specify each API-action\r</i>
-api: {\r
- load: {url: <em>'read.php'</em>, method: <em>'GET'</em>},\r
- create: <em>'create.php'</em>,\r
- destroy: <em>'destroy.php'</em>,\r
- save: <em>'update.php'</em>\r
-}</code></pre>\r
-<p>If the specific URL for a given CRUD action is undefined, the CRUD action request\r
-will be directed to the configured <tt><a href="output/Ext.data.Connection.html#Ext.data.Connection-url" ext:member="url" ext:cls="Ext.data.Connection">url</a></tt>.</p>\r
-<br><p><b>Note</b>: To modify the URL for an action dynamically the appropriate API\r
-property should be modified before the action is requested using the corresponding before\r
-action event. For example to modify the URL associated with the load action:\r
-<pre><code><i>// modify the url <b>for</b> the action\r</i>
-myStore.on({\r
- beforeload: {\r
- fn: <b>function</b> (store, options) {\r
- <i>// use <tt><a href="output/Ext.data.HttpProxy.html#Ext.data.HttpProxy-setUrl" ext:member="setUrl" ext:cls="Ext.data.HttpProxy">setUrl</a></tt> to change the URL <b>for</b> *just* this request.\r</i>
- store.proxy.setUrl(<em>'changed1.php'</em>);\r
-\r
- <i>// set optional second parameter to true to make this URL change\r</i>
- <i>// permanent, applying this URL <b>for</b> all subsequent requests.\r</i>
- store.proxy.setUrl(<em>'changed1.php'</em>, true);\r
-\r
- <i>// Altering the proxy API should be done using the public\r</i>
- <i>// method <tt><a href="output/Ext.data.DataProxy.html#Ext.data.DataProxy-setApi" ext:member="setApi" ext:cls="Ext.data.DataProxy">setApi</a></tt>.\r</i>
- store.proxy.setApi(<em>'read'</em>, <em>'changed2.php'</em>);\r
-\r
- <i>// Or set the entire API <b>with</b> a config-object.\r</i>
- <i>// When using the config-object option, you must redefine the <b>entire</b>\r</i>
- <i>// API -- not just a specific action of it.\r</i>
- store.proxy.setApi({\r
- read : <em>'changed_read.php'</em>,\r
- create : <em>'changed_create.php'</em>,\r
- update : <em>'changed_update.php'</em>,\r
- destroy : <em>'changed_destroy.php'</em>\r
- });\r
- }\r
- }\r
-});</code></pre>\r
-</p></div></div></td><td class="msource"><a href="output/Ext.data.DataProxy.html#api" ext:member="#api" ext:cls="Ext.data.DataProxy">DataProxy</a></td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.ScriptTagProxy-callbackParam"></a><b><a href="source/ScriptTagProxy.html#cfg-Ext.data.ScriptTagProxy-callbackParam">callbackParam</a></b> : String<div class="mdesc"><div class="short">The name of the parameter to pass to the server which tells
-the server the name of the callback function set up by t...</div><div class="long">The name of the parameter to pass to the server which tells\r
-the server the name of the callback function set up by the load call to process the returned data object.\r
-Defaults to "callback".<p>The server-side processing must read this parameter value, and generate\r
-javascript output which calls this named function passing the data object as its only parameter.</div></div></td><td class="msource">ScriptTagProxy</td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.DataProxy-doRequest"></a><b><a href="source/DataProxy.html#cfg-Ext.data.DataProxy-doRequest">doRequest</a></b> : Function<div class="mdesc"><div class="short">Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. ...</div><div class="long">Abstract method that should be implemented in all subclasses. <b>Note:</b> Should only be used by custom-proxy developers.\r
-(e.g.: <a href="output/Ext.data.HttpProxy.html#Ext.data.HttpProxy-doRequest" ext:member="doRequest" ext:cls="Ext.data.HttpProxy">HttpProxy.doRequest</a>,\r
+<div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.data.ScriptTagProxy-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> <a class="inner-link" href="#Ext.data.ScriptTagProxy-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a> <a class="inner-link" href="#Ext.data.ScriptTagProxy-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a> <a class="inner-link" href="#Ext.data.ScriptTagProxy-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a> <a class="bookmark" href="../docs/?class=Ext.data.ScriptTagProxy"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> </div><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.Observable.html" ext:member="" ext:cls="Ext.util.Observable">Observable</a> <img src="resources/elbow-end.gif"><a href="output/Ext.data.DataProxy.html" ext:member="" ext:cls="Ext.data.DataProxy">DataProxy</a> <img src="resources/elbow-end.gif">ScriptTagProxy</pre></div><h1>Class <a href="source/ScriptTagProxy.html#cls-Ext.data.ScriptTagProxy">Ext.data.ScriptTagProxy</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/ScriptTagProxy.html#cls-Ext.data.ScriptTagProxy">ScriptTagProxy.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/ScriptTagProxy.html#cls-Ext.data.ScriptTagProxy">ScriptTagProxy</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.data.DataProxy.html" ext:cls="Ext.data.DataProxy" ext:member="">DataProxy</a></td></tr></table><div class="description">An implementation of Ext.data.DataProxy that reads a data object from a URL which may be in a domain
+other than the originating domain of the running page.<br>
+<p>
+<b>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.</b><br>
+<p>
+The content passed back from a server resource requested by a ScriptTagProxy <b>must</b> be executable JavaScript
+source code because it is used as the source inside a <script> tag.<br>
+<p>
+In order for the browser to process the returned data, the server must wrap the data object
+with a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy.
+Below is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy
+depending on whether the callback name was passed:
+<p>
+<pre><code>boolean scriptTag = false;
+String cb = request.getParameter(<em>"callback"</em>);
+<b>if</b> (cb != null) {
+ scriptTag = true;
+ response.setContentType(<em>"text/javascript"</em>);
+} <b>else</b> {
+ response.setContentType(<em>"application/x-json"</em>);
+}
+Writer out = response.getWriter();
+<b>if</b> (scriptTag) {
+ out.write(cb + <em>"("</em>);
+}
+out.print(dataBlock.toJsonString());
+<b>if</b> (scriptTag) {
+ out.write(<em>");"</em>);
+}</code></pre>
+<p>Below is a PHP example to do the same thing:</p><pre><code>$callback = $_REQUEST[<em>'callback'</em>];
+
+<i>// Create the output object.</i>
+$output = array(<em>'a'</em> => <em>'Apple'</em>, <em>'b'</em> => <em>'Banana'</em>);
+
+<i>//start output</i>
+<b>if</b> ($callback) {
+ header(<em>'Content-Type: text/javascript'</em>);
+ echo $callback . <em>'('</em> . json_encode($output) . <em>');'</em>;
+} <b>else</b> {
+ header(<em>'Content-Type: application/x-json'</em>);
+ echo json_encode($output);
+}</code></pre>
+<p>Below is the ASP.Net code to do the same thing:</p><pre><code>String jsonString = <em>"{success: true}"</em>;
+String cb = Request.Params.Get(<em>"callback"</em>);
+String responseString = <em>""</em>;
+<b>if</b> (!String.IsNullOrEmpty(cb)) {
+ responseString = cb + <em>"("</em> + jsonString + <em>")"</em>;
+} <b>else</b> {
+ responseString = jsonString;
+}
+Response.Write(responseString);</code></pre></div><div class="hr"></div><a id="Ext.data.ScriptTagProxy-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.DataProxy-api"></a><b><a href="source/DataProxy.html#cfg-Ext.data.DataProxy-api">api</a></b> : Object<div class="mdesc"><div class="short">Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".
+Defaults to:api: {
+ read ...</div><div class="long">Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".
+Defaults to:<pre><code>api: {
+ read : undefined,
+ create : undefined,
+ update : undefined,
+ destroy : undefined
+}</code></pre>
+<p>The url is built based upon the action being executed <tt>[load|create|save|destroy]</tt>
+using the commensurate <tt><a href="output/Ext.data.DataProxy.html#Ext.data.DataProxy-api" ext:member="api" ext:cls="Ext.data.DataProxy">api</a></tt> property, or if undefined default to the
+configured <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Ext.data.Store</a>.<a href="output/Ext.data.Store.html#Ext.data.Store-url" ext:member="url" ext:cls="Ext.data.Store">url</a>.</p><br>
+<p>For example:</p>
+<pre><code>api: {
+ load : <em>'/controller/load'</em>,
+ create : <em>'/controller/<b>new</b>'</em>, <i>// Server MUST <b>return</b> idProperty of <b>new</b> record</i>
+ save : <em>'/controller/update'</em>,
+ destroy : <em>'/controller/destroy_action'</em>
+}
+
+<i>// Alternatively, one can use the object-form to specify each API-action</i>
+api: {
+ load: {url: <em>'read.php'</em>, method: <em>'GET'</em>},
+ create: <em>'create.php'</em>,
+ destroy: <em>'destroy.php'</em>,
+ save: <em>'update.php'</em>
+}</code></pre>
+<p>If the specific URL for a given CRUD action is undefined, the CRUD action request
+will be directed to the configured <tt><a href="output/Ext.data.Connection.html#Ext.data.Connection-url" ext:member="url" ext:cls="Ext.data.Connection">url</a></tt>.</p>
+<br><p><b>Note</b>: To modify the URL for an action dynamically the appropriate API
+property should be modified before the action is requested using the corresponding before
+action event. For example to modify the URL associated with the load action:
+<pre><code><i>// modify the url <b>for</b> the action</i>
+myStore.on({
+ beforeload: {
+ fn: <b>function</b> (store, options) {
+ <i>// use <tt><a href="output/Ext.data.HttpProxy.html#Ext.data.HttpProxy-setUrl" ext:member="setUrl" ext:cls="Ext.data.HttpProxy">setUrl</a></tt> to change the URL <b>for</b> *just* this request.</i>
+ store.proxy.setUrl(<em>'changed1.php'</em>);
+
+ <i>// set optional second parameter to true to make this URL change</i>
+ <i>// permanent, applying this URL <b>for</b> all subsequent requests.</i>
+ store.proxy.setUrl(<em>'changed1.php'</em>, true);
+
+ <i>// Altering the proxy API should be done using the public</i>
+ <i>// method <tt><a href="output/Ext.data.DataProxy.html#Ext.data.DataProxy-setApi" ext:member="setApi" ext:cls="Ext.data.DataProxy">setApi</a></tt>.</i>
+ store.proxy.setApi(<em>'read'</em>, <em>'changed2.php'</em>);
+
+ <i>// Or set the entire API <b>with</b> a config-object.</i>
+ <i>// When using the config-object option, you must redefine the <b>entire</b></i>
+ <i>// API -- not just a specific action of it.</i>
+ store.proxy.setApi({
+ read : <em>'changed_read.php'</em>,
+ create : <em>'changed_create.php'</em>,
+ update : <em>'changed_update.php'</em>,
+ destroy : <em>'changed_destroy.php'</em>
+ });
+ }
+ }
+});</code></pre>
+</p></div></div></td><td class="msource"><a href="output/Ext.data.DataProxy.html#api" ext:member="#api" ext:cls="Ext.data.DataProxy">DataProxy</a></td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.ScriptTagProxy-callbackParam"></a><b><a href="source/ScriptTagProxy.html#cfg-Ext.data.ScriptTagProxy-callbackParam">callbackParam</a></b> : String<div class="mdesc"><div class="short">The name of the parameter to pass to the server which tells
+the server the name of the callback function set up by th...</div><div class="long">The name of the parameter to pass to the server which tells
+the server the name of the callback function set up by the load call to process the returned data object.
+Defaults to "callback".<p>The server-side processing must read this parameter value, and generate
+javascript output which calls this named function passing the data object as its only parameter.</div></div></td><td class="msource">ScriptTagProxy</td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.data.DataProxy-doRequest"></a><b><a href="source/DataProxy.html#cfg-Ext.data.DataProxy-doRequest">doRequest</a></b> : Function<div class="mdesc"><div class="short">Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers.
+...</div><div class="long">Abstract method that should be implemented in all subclasses. <b>Note:</b> Should only be used by custom-proxy developers.
+(e.g.: <a href="output/Ext.data.HttpProxy.html#Ext.data.HttpProxy-doRequest" ext:member="doRequest" ext:cls="Ext.data.HttpProxy">HttpProxy.doRequest</a>,