6598698e601214fbfc6f98a3f0ae8ebbda7ec705
[roojs1] / docs / symbols / Roo.data.ScriptTagProxy.json
1 {
2   "name" : "Roo.data.ScriptTagProxy",
3   "augments" : [],
4   "childClasses" : {  },
5   "tree_children" : [],
6   "tree_parent" : [],
7   "desc" : "An implementation of Roo.data.DataProxy that reads a data object from a URL which may be in a domain\nother than the originating domain of the running page.<br><br>\n<p>\n<em>Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain\nof the running page, you must use this class, rather than DataProxy.</em><br><br>\n<p>\nThe content passed back from a server resource requested by a ScriptTagProxy is executable JavaScript\nsource code that is used as the source inside a &lt;script> tag.<br><br>\n<p>\nIn order for the browser to process the returned data, the server must wrap the data object\nwith a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy.\nBelow is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy\ndepending on whether the callback name was passed:\n<p>\n<pre><code>\nboolean scriptTag = false;\nString cb = request.getParameter(\"callback\");\nif (cb != null) {\n    scriptTag = true;\n    response.setContentType(\"text/javascript\");\n} else {\n    response.setContentType(\"application/x-json\");\n}\nWriter out = response.getWriter();\nif (scriptTag) {\n    out.write(cb + \"(\");\n}\nout.print(dataBlock.toJsonString());\nif (scriptTag) {\n    out.write(\");\");\n}\n</pre></code>",
8   "isSingleton" : false,
9   "isStatic" : false,
10   "isBuiltin" : false,
11   "isAbstract" : false,
12   "isBuilderTop" : false,
13   "memberOf" : "ScriptTagProxy",
14   "example" : "",
15   "deprecated" : "",
16   "since" : "",
17   "see" : "",
18   "params" : [
19     {
20       "name" : "config",
21       "type" : "Object",
22       "desc" : "A configuration object.",
23       "isOptional" : false
24     }
25   ],
26   "returns" : [],
27   "throws" : "",
28   "requires" : "",
29   "config" : [
30     {
31       "name" : "timeout",
32       "type" : "Number",
33       "desc" : "(Optional) The number of milliseconds to wait for a response. Defaults to 30 seconds.",
34       "memberOf" : "Roo.data.ScriptTagProxy"
35     },
36     {
37       "name" : "nocache",
38       "type" : "Boolean",
39       "desc" : "(Optional) Defaults to true. Disable cacheing by adding a unique parameter\nname to the request.",
40       "memberOf" : "Roo.data.ScriptTagProxy"
41     },
42     {
43       "name" : "callbackParam",
44       "type" : "String",
45       "desc" : "(Optional) The name of the parameter to pass to the server which tells\nthe server the name of the callback function set up by the load call to process the returned data object.\nDefaults to \"callback\".<p>The server-side processing must read this parameter value, and generate\njavascript output which calls this named function passing the data object as its only parameter.",
46       "memberOf" : "Roo.data.ScriptTagProxy"
47     },
48     {
49       "name" : "url",
50       "type" : "String",
51       "desc" : "The URL from which to request the data object.",
52       "memberOf" : "Roo.data.ScriptTagProxy"
53     }
54   ],
55   "methods" : [
56     {
57       "name" : "abort",
58       "type" : "function",
59       "desc" : "Abort the current server request.",
60       "sig" : "()\n{\n\n}",
61       "static" : false,
62       "memberOf" : "",
63       "isStatic" : false,
64       "isConstructor" : false,
65       "isPrivate" : false,
66       "example" : "",
67       "deprecated" : "",
68       "since" : "",
69       "see" : "",
70       "exceptions" : "",
71       "requires" : "",
72       "params" : [],
73       "returns" : []
74     },
75     {
76       "name" : "load",
77       "type" : "function",
78       "desc" : "Load data from the configured URL, read the data object into\na block of Roo.data.Records using the passed Roo.data.DataReader implementation, and\nprocess that block using the passed callback.",
79       "sig" : "(params, reader, callback, scope, arg)",
80       "static" : false,
81       "memberOf" : "",
82       "isStatic" : false,
83       "isConstructor" : false,
84       "isPrivate" : false,
85       "example" : "",
86       "deprecated" : "",
87       "since" : "",
88       "see" : "",
89       "exceptions" : "",
90       "requires" : "",
91       "params" : [
92         {
93           "name" : "params",
94           "type" : "Object",
95           "desc" : "An object containing properties which are to be used as HTTP parameters\nfor the request to the remote server.",
96           "isOptional" : false
97         },
98         {
99           "name" : "reader",
100           "type" : "Roo.data.DataReader",
101           "desc" : "The Reader object which converts the data\nobject into a block of Roo.data.Records.",
102           "isOptional" : false
103         },
104         {
105           "name" : "callback",
106           "type" : "Function",
107           "desc" : "The function into which to pass the block of Roo.data.Records.\nThe function must be passed <ul>\n<li>The Record block object</li>\n<li>The \"arg\" argument from the load function</li>\n<li>A boolean success indicator</li>\n</ul>",
108           "isOptional" : false
109         },
110         {
111           "name" : "scope",
112           "type" : "Object",
113           "desc" : "The scope in which to call the callback",
114           "isOptional" : false
115         },
116         {
117           "name" : "arg",
118           "type" : "Object",
119           "desc" : "An optional argument which is passed to the callback as its second parameter.",
120           "isOptional" : false
121         }
122       ],
123       "returns" : []
124     }
125   ],
126   "events" : []
127 }