Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / api / Ext.data.proxy.JsonP.html
1 <!DOCTYPE html><html><head><title>Ext.data.proxy.JsonP | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
2 <style type="text/css">.head-band { display: none; }
3 .header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
4 .doc-tab .members .member a.more { background-color: #efefef; }
5 </style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
6 </head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
7 <a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">
8
9     req = {
10         liveURL: '.',
11         standAloneMode: true,
12         origDocClass: 'Ext.data.proxy.JsonP',
13         docClass: 'Ext.data.proxy.JsonP',
14         docReq: 'Ext.data.proxy.JsonP',
15         version: '4.0',
16         baseURL: '.',
17         baseDocURL: '.',
18         baseProdURL: '.'
19     };
20
21     clsInfo = {};
22
23
24
25 </script>
26
27 <script type="text/javascript" src="../search.js"></script>
28 <!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
29 <script type="text/javascript" src="../class_tree.js"></script>
30 <script type="text/javascript" src="../class_doc.js"></script>
31 <script type="text/javascript">
32     req.source = 'JsonP2.html#Ext-data.proxy.JsonP';
33     clsInfo = {"methods":["JsonP","abort","addEvents","addListener","addManagedListener","batch","buildRequest","buildUrl","capture","clearListeners","clearManagedListeners","doRequest","enableBubble","encodeFilters","encodeRecords","encodeSorters","fireEvent","getModel","getReader","getWriter","hasListener","observe","on","processResponse","relayEvents","releaseCapture","removeListener","removeManagedListener","resumeEvents","setModel","setReader","setWriter","suspendEvents","un"],"cfgs":["api","autoAppendParams","batchActions","batchOrder","cacheString","callbackKey","directionParam","extraParams","filterParam","groupParam","limitParam","listeners","model","noCache","pageParam","reader","recordParam","simpleSortMode","sortParam","startParam","timeout","url","writer"],"properties":["afterRequest","create","destroy","read","update"],"events":["exception"],"subclasses":[]};
34     Ext.onReady(function() {
35         Ext.create('Docs.classPanel');
36     });
37 </script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/JsonP2.html#Ext-data.proxy.JsonP" target="_blank">Ext.data.proxy.JsonP</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><pre class="subclasses"><h4>Hierarchy</h4><div class="subclass f"><a href="Ext.data.proxy.Proxy.html" rel="Ext.data.proxy.Proxy" class="cls docClass">Ext.data.proxy.Proxy</a><div class="subclass"><a href="Ext.data.proxy.Server.html" rel="Ext.data.proxy.Server" class="cls docClass">Ext.data.proxy.Server</a><div class="subclass"><strong>Ext.data.proxy.JsonP</strong></div></div></div><h4>Mixins</h4><div class="mixin"><a href="Ext.util.Observable.html" rel="Ext.util.Observable" class="cls docClass">Ext.util.Observable</a></div></pre><p>JsonPProxy is useful when you need to load data from a domain other than the one your application is running
38 on. If your application is running on http://domainA.com it cannot use <a href="Ext.data.proxy.Ajax.html" rel="Ext.data.proxy.Ajax" class="docClass">Ajax</a> to load its
39 data from http://domainB.com because cross-domain ajax requests are prohibited by the browser.</p>
40
41
42
43
44 <p>We can get around this using a JsonPProxy. JsonPProxy injects a &lt;script&gt; tag into the DOM whenever
45 an AJAX request would usually be made. Let's say we want to load data from http://domainB.com/users - the script tag
46 that would be injected might look like this:</p>
47
48
49
50
51 <pre class="prettyprint"><code>&lt;script src="http://domainB.com/users?callback=someCallback"&gt;&lt;/script&gt;
52 </code></pre>
53
54
55
56
57 <p>When we inject the tag above, the browser makes a request to that url and includes the response as if it was any
58 other type of JavaScript include. By passing a callback in the url above, we're telling domainB's server that we
59 want to be notified when the result comes in and that it should call our callback function with the data it sends
60 back. So long as the server formats the response to look like this, everything will work:</p>
61
62
63
64
65 <pre class="prettyprint"><code>someCallback({
66     users: [
67         {
68             id: 1,
69             name: "Ed Spencer",
70             email: "ed@sencha.com"
71         }
72     ]
73 });
74 </code></pre>
75
76
77
78
79 <p>As soon as the script finishes loading, the 'someCallback' function that we passed in the url is called with the
80 JSON object that the server returned.</p>
81
82
83
84
85 <p>JsonPProxy takes care of all of this automatically. It formats the url you pass, adding the callback
86 parameter automatically. It even creates a temporary callback function, waits for it to be called and then puts
87 the data into the Proxy making it look just like you loaded it through a normal <a href="Ext.data.proxy.Ajax.html" rel="Ext.data.proxy.Ajax" class="docClass">AjaxProxy</a>.
88 Here's how we might set that up:</p>
89
90
91
92
93 <pre class="prettyprint"><code>Ext.define('User', {
94     extend: 'Ext.data.Model',
95     fields: ['id', 'name', 'email']
96 });
97
98 var store = new Ext.data.Store({
99     model: 'User',
100     proxy: {
101         type: 'jsonp',
102         url : 'http://domainB.com/users'
103     }
104 });
105
106 store.load();
107 </code></pre>
108
109
110
111
112 <p>That's all we need to do - JsonPProxy takes care of the rest. In this case the Proxy will have injected a
113 script tag like this:
114
115 <pre class="prettyprint"><code>&lt;script src="http://domainB.com/users?callback=stcCallback001" id="stcScript001"&gt;&lt;/script&gt;
116 </code></pre>
117
118 <p><u>Customization</u></p>
119
120 <p>Most parts of this script tag can be customized using the <a href="Ext.data.proxy.JsonP.html#callbackParam" rel="Ext.data.proxy.JsonP#callbackParam" class="docClass">callbackParam</a>, <a href="Ext.data.proxy.JsonP.html#callbackPrefix" rel="Ext.data.proxy.JsonP#callbackPrefix" class="docClass">callbackPrefix</a> and
121 <a href="Ext.data.proxy.JsonP.html#scriptIdPrefix" rel="Ext.data.proxy.JsonP#scriptIdPrefix" class="docClass">scriptIdPrefix</a> configurations. For example:
122
123 <pre class="prettyprint"><code>var store = new Ext.data.Store({
124     model: 'User',
125     proxy: {
126         type: 'jsonp',
127         url : 'http://domainB.com/users',
128         callbackParam: 'theCallbackFunction',
129         callbackPrefix: 'ABC',
130         scriptIdPrefix: 'injectedScript'
131     }
132 });
133
134 store.load();
135 </code></pre>
136
137 <p>Would inject a script tag like this:</p>
138
139 <pre class="prettyprint"><code>&lt;script src="http://domainB.com/users?theCallbackFunction=ABC001" id="injectedScript001"&gt;&lt;/script&gt;
140 </code></pre>
141
142 <p><u>Implementing on the server side</u></p>
143
144 <p>The remote server side needs to be configured to return data in this format. Here are suggestions for how you
145 might achieve this using Java, PHP and ASP.net:</p>
146
147 <p>Java:</p>
148
149 <pre class="prettyprint"><code>boolean jsonP = false;
150 String cb = request.getParameter("callback");
151 if (cb != null) {
152     jsonP = true;
153     response.setContentType("text/javascript");
154 } else {
155     response.setContentType("application/x-json");
156 }
157 Writer out = response.getWriter();
158 if (jsonP) {
159     out.write(cb + "(");
160 }
161 out.print(dataBlock.toJsonString());
162 if (jsonP) {
163     out.write(");");
164 }
165 </code></pre>
166
167 <p>PHP:</p>
168
169 <pre class="prettyprint"><code>$callback = $_REQUEST['callback'];
170
171 // Create the output object.
172 $output = array('a' => 'Apple', 'b' => 'Banana');
173
174 //start output
175 if ($callback) {
176     header('Content-Type: text/javascript');
177     echo $callback . '(' . json_encode($output) . ');';
178 } else {
179     header('Content-Type: application/x-json');
180     echo json_encode($output);
181 }
182 </code></pre>
183
184 <p>ASP.net:</p>
185
186 <pre class="prettyprint"><code>String jsonString = "{success: true}";
187 String cb = Request.Params.Get("callback");
188 String responseString = "";
189 if (!String.IsNullOrEmpty(cb)) {
190     responseString = cb + "(" + jsonString + ")";
191 } else {
192     responseString = jsonString;
193 }
194 Response.Write(responseString);
195 </code></pre>
196
197 <div class="members"><div class="m-cfgs"><div class="definedBy">Defined By</div><a name="configs"></a><h3 class="cfg p">Config Options</h3><h4 class="cfgGroup">Other Configs</h4><div id="config-api" class="member f inherited"><a href="Ext.data.proxy.JsonP.html#config-api" rel="config-api" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-api" class="viewSource">view source</a></div><a name="api"></a><a name="config-api"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-api" class="cls expand">api</a><span> : Object</span></div><div class="description"><div class="short">Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".
198 Defaults to:
199
200 api: {
201     read ...</div><div class="long"><p>Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".
202 Defaults to:</p>
203
204 <pre><code>api: {
205     read    : undefined,
206     create  : undefined,
207     update  : undefined,
208     destroy : undefined
209 }
210 </code></pre>
211
212
213 <p>The url is built based upon the action being executed <tt>[load|create|save|destroy]</tt>
214 using the commensurate <tt><a href="Ext.data.proxy.JsonP.html#api" rel="Ext.data.proxy.JsonP#api" class="docClass">api</a></tt> property, or if undefined default to the
215 configured <a href="Ext.data.Store.html" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>.<a href="Ext.data.proxy.Server.html#url" rel="Ext.data.proxy.Server#url" class="docClass">url</a>.</p>
216
217
218 <br>
219
220
221 <p>For example:</p>
222
223
224 <pre><code>api: {
225     load :    '/controller/load',
226     create :  '/controller/new',
227     save :    '/controller/update',
228     destroy : '/controller/destroy_action'
229 }
230 </code></pre>
231
232
233 <p>If the specific URL for a given CRUD action is undefined, the CRUD action request
234 will be directed to the configured <tt><a href="Ext.data.proxy.Server.html#url" rel="Ext.data.proxy.Server#url" class="docClass">url</a></tt>.</p>
235
236 </div></div></div><div id="config-autoAppendParams" class="member ni"><a href="Ext.data.proxy.JsonP.html#config-autoAppendParams" rel="config-autoAppendParams" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.JsonP.html" class="definedIn docClass">Ext.data.proxy.JsonP</a><br/><a href="../source/JsonP2.html#Ext-data.proxy.JsonP-cfg-autoAppendParams" class="viewSource">view source</a></div><a name="autoAppendParams"></a><a name="config-autoAppendParams"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-autoAppendParams" class="cls expand">autoAppendParams</a><span> : Boolean</span></div><div class="description"><div class="short"><p>True to automatically append the request's params to the generated url. Defaults to true</p>
237 </div><div class="long"><p>True to automatically append the request's params to the generated url. Defaults to true</p>
238 </div></div></div><div id="config-batchActions" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-batchActions" rel="config-batchActions" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-cfg-batchActions" class="viewSource">view source</a></div><a name="batchActions"></a><a name="config-batchActions"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-batchActions" class="cls expand">batchActions</a><span> : Boolean</span></div><div class="description"><div class="short"><p>True to batch actions of a particular type when synchronizing the store.
239 Defaults to <tt>true</tt>.</p>
240 </div><div class="long"><p>True to batch actions of a particular type when synchronizing the store.
241 Defaults to <tt>true</tt>.</p>
242 </div></div></div><div id="config-batchOrder" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-batchOrder" rel="config-batchOrder" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-cfg-batchOrder" class="viewSource">view source</a></div><a name="batchOrder"></a><a name="config-batchOrder"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-batchOrder" class="cls expand">batchOrder</a><span> : String</span></div><div class="description"><div class="short">Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. Override this
243 to set a different ord...</div><div class="long"><p>Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. Override this
244 to set a different order for the batched CRUD actions to be executed in. Defaults to 'create,update,destroy'</p>
245 </div></div></div><div id="config-cacheString" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-cacheString" rel="config-cacheString" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-cacheString" class="viewSource">view source</a></div><a name="cacheString"></a><a name="config-cacheString"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-cacheString" class="cls expand">cacheString</a><span> : String</span></div><div class="description"><div class="short"><p>The name of the cache param added to the url when using noCache (defaults to "_dc")</p>
246 </div><div class="long"><p>The name of the cache param added to the url when using noCache (defaults to "_dc")</p>
247 </div></div></div><div id="config-callbackKey" class="member ni"><a href="Ext.data.proxy.JsonP.html#config-callbackKey" rel="config-callbackKey" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.JsonP.html" class="definedIn docClass">Ext.data.proxy.JsonP</a><br/><a href="../source/JsonP2.html#Ext-data.proxy.JsonP-cfg-callbackKey" class="viewSource">view source</a></div><a name="callbackKey"></a><a name="config-callbackKey"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-callbackKey" class="cls expand">callbackKey</a><span> : String</span></div><div class="description"><div class="short"><p>(Optional) See <a href="Ext.data.JsonP.html#callbackKey" rel="Ext.data.JsonP#callbackKey" class="docClass">Ext.data.JsonP.callbackKey</a>.</p>
248 </div><div class="long"><p>(Optional) See <a href="Ext.data.JsonP.html#callbackKey" rel="Ext.data.JsonP#callbackKey" class="docClass">Ext.data.JsonP.callbackKey</a>.</p>
249 </div></div></div><div id="config-directionParam" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-directionParam" rel="config-directionParam" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-directionParam" class="viewSource">view source</a></div><a name="directionParam"></a><a name="config-directionParam"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-directionParam" class="cls expand">directionParam</a><span> : String</span></div><div class="description"><div class="short">The name of the direction parameter to send in a request. This is only used when simpleSortMode is set to true.
250 Defau...</div><div class="long"><p>The name of the direction parameter to send in a request. <strong>This is only used when simpleSortMode is set to true.</strong>
251 Defaults to 'dir'.</p>
252 </div></div></div><div id="config-extraParams" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-extraParams" rel="config-extraParams" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-extraParams" class="viewSource">view source</a></div><a name="extraParams"></a><a name="config-extraParams"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-extraParams" class="cls expand">extraParams</a><span> : Object</span></div><div class="description"><div class="short">Extra parameters that will be included on every request. Individual requests with params
253 of the same name will overri...</div><div class="long"><p>Extra parameters that will be included on every request. Individual requests with params
254 of the same name will override these params when they are in conflict.</p>
255 </div></div></div><div id="config-filterParam" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-filterParam" rel="config-filterParam" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-filterParam" class="viewSource">view source</a></div><a name="filterParam"></a><a name="config-filterParam"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-filterParam" class="cls expand">filterParam</a><span> : String</span></div><div class="description"><div class="short">The name of the 'filter' parameter to send in a request. Defaults to 'filter'. Set
256 this to undefined if you don't wan...</div><div class="long"><p>The name of the 'filter' parameter to send in a request. Defaults to 'filter'. Set
257 this to undefined if you don't want to send a filter parameter</p>
258 </div></div></div><div id="config-groupParam" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-groupParam" rel="config-groupParam" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-groupParam" class="viewSource">view source</a></div><a name="groupParam"></a><a name="config-groupParam"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-groupParam" class="cls expand">groupParam</a><span> : String</span></div><div class="description"><div class="short">The name of the 'group' parameter to send in a request. Defaults to 'group'. Set this
259 to undefined if you don't want ...</div><div class="long"><p>The name of the 'group' parameter to send in a request. Defaults to 'group'. Set this
260 to undefined if you don't want to send a group parameter</p>
261 </div></div></div><div id="config-limitParam" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-limitParam" rel="config-limitParam" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-limitParam" class="viewSource">view source</a></div><a name="limitParam"></a><a name="config-limitParam"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-limitParam" class="cls expand">limitParam</a><span> : String</span></div><div class="description"><div class="short">The name of the 'limit' parameter to send in a request. Defaults to 'limit'. Set this
262 to undefined if you don't want ...</div><div class="long"><p>The name of the 'limit' parameter to send in a request. Defaults to 'limit'. Set this
263 to undefined if you don't want to send a limit parameter</p>
264 </div></div></div><div id="config-listeners" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-listeners" rel="config-listeners" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-cfg-listeners" class="viewSource">view source</a></div><a name="listeners"></a><a name="config-listeners"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-listeners" class="cls expand">listeners</a><span> : Object</span></div><div class="description"><div class="short">(optional) A config object containing one or more event handlers to be added to this
265 object during initialization.  T...</div><div class="long"><p>(optional) <p>A config object containing one or more event handlers to be added to this
266 object during initialization.  This should be a valid listeners config object as specified in the
267 <a href="Ext.data.proxy.JsonP.html#addListener" rel="Ext.data.proxy.JsonP#addListener" class="docClass">addListener</a> example for attaching multiple handlers at once.</p></p>
268
269 <br><p><b><u>DOM events from ExtJs <a href="Ext.Component.html" rel="Ext.Component" class="docClass">Components</a></u></b></p>
270
271
272 <br><p>While <i>some</i> ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
273
274
275 <p>is usually only done when extra value can be added. For example the <a href="Ext.view.View.html" rel="Ext.view.View" class="docClass">DataView</a>'s
276 <b><code><a href="Ext.view.View.html#click" rel="Ext.view.View#click" class="docClass">click</a></code></b> event passing the node clicked on. To access DOM
277 events directly from a child element of a Component, we need to specify the <code>element</code> option to
278 identify the Component property to add a DOM listener to:</p>
279
280 <pre><code>new Ext.panel.Panel({
281     width: 400,
282     height: 200,
283     dockedItems: [{
284         xtype: 'toolbar'
285     }],
286     listeners: {
287         click: {
288             element: 'el', //bind to the underlying el property on the panel
289             fn: function(){ console.log('click el'); }
290         },
291         dblclick: {
292             element: 'body', //bind to the underlying body property on the panel
293             fn: function(){ console.log('dblclick body'); }
294         }
295     }
296 });
297 </code></pre>
298
299
300 <p></p></p>
301 </div></div></div><div id="config-model" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-model" rel="config-model" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-cfg-model" class="viewSource">view source</a></div><a name="model"></a><a name="config-model"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-model" class="cls expand">model</a><span> : String/Ext.data.Model</span></div><div class="description"><div class="short">The name of the Model to tie to this Proxy. Can be either the string name of
302 the Model, or a reference to the Model c...</div><div class="long"><p>The name of the Model to tie to this Proxy. Can be either the string name of
303 the Model, or a reference to the Model constructor. Required.</p>
304 </div></div></div><div id="config-noCache" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-noCache" rel="config-noCache" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-noCache" class="viewSource">view source</a></div><a name="noCache"></a><a name="config-noCache"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-noCache" class="cls expand">noCache</a><span> : Boolean</span></div><div class="description"><div class="short"><p>(optional) Defaults to true. Disable caching by adding a unique parameter
305 name to the request.</p>
306 </div><div class="long"><p>(optional) Defaults to true. Disable caching by adding a unique parameter
307 name to the request.</p>
308 </div></div></div><div id="config-pageParam" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-pageParam" rel="config-pageParam" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-pageParam" class="viewSource">view source</a></div><a name="pageParam"></a><a name="config-pageParam"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-pageParam" class="cls expand">pageParam</a><span> : String</span></div><div class="description"><div class="short">The name of the 'page' parameter to send in a request. Defaults to 'page'. Set this to
309 undefined if you don't want to...</div><div class="long"><p>The name of the 'page' parameter to send in a request. Defaults to 'page'. Set this to
310 undefined if you don't want to send a page parameter</p>
311 </div></div></div><div id="config-reader" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-reader" rel="config-reader" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-reader" class="viewSource">view source</a></div><a name="reader"></a><a name="config-reader"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-reader" class="cls expand">reader</a><span> : Object/String/Ext.data.reader.Reader</span></div><div class="description"><div class="short">The Ext.data.reader.Reader to use to decode the server's response. This can
312 either be a Reader instance, a config obj...</div><div class="long"><p>The <a href="Ext.data.reader.Reader.html" rel="Ext.data.reader.Reader" class="docClass">Ext.data.reader.Reader</a> to use to decode the server's response. This can
313 either be a Reader instance, a config object or just a valid Reader type name (e.g. 'json', 'xml').</p>
314 </div></div></div><div id="config-recordParam" class="member ni"><a href="Ext.data.proxy.JsonP.html#config-recordParam" rel="config-recordParam" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.JsonP.html" class="definedIn docClass">Ext.data.proxy.JsonP</a><br/><a href="../source/JsonP2.html#Ext-data.proxy.JsonP-cfg-recordParam" class="viewSource">view source</a></div><a name="recordParam"></a><a name="config-recordParam"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-recordParam" class="cls expand">recordParam</a><span> : String</span></div><div class="description"><div class="short">The param name to use when passing records to the server (e.g. 'records=someEncodedRecordString').
315 Defaults to 'recor...</div><div class="long"><p>The param name to use when passing records to the server (e.g. 'records=someEncodedRecordString').
316 Defaults to 'records'</p>
317 </div></div></div><div id="config-simpleSortMode" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-simpleSortMode" rel="config-simpleSortMode" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-simpleSortMode" class="viewSource">view source</a></div><a name="simpleSortMode"></a><a name="config-simpleSortMode"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-simpleSortMode" class="cls expand">simpleSortMode</a><span> : Boolean</span></div><div class="description"><div class="short">Enabling simpleSortMode in conjunction with remoteSort will only send one sort property and a direction when a remote...</div><div class="long"><p>Enabling simpleSortMode in conjunction with remoteSort will only send one sort property and a direction when a remote sort is requested.
318 The directionParam and sortParam will be sent with the property name and either 'ASC' or 'DESC'</p>
319 </div></div></div><div id="config-sortParam" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-sortParam" rel="config-sortParam" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-sortParam" class="viewSource">view source</a></div><a name="sortParam"></a><a name="config-sortParam"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-sortParam" class="cls expand">sortParam</a><span> : String</span></div><div class="description"><div class="short">The name of the 'sort' parameter to send in a request. Defaults to 'sort'. Set this
320 to undefined if you don't want to...</div><div class="long"><p>The name of the 'sort' parameter to send in a request. Defaults to 'sort'. Set this
321 to undefined if you don't want to send a sort parameter</p>
322 </div></div></div><div id="config-startParam" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-startParam" rel="config-startParam" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-startParam" class="viewSource">view source</a></div><a name="startParam"></a><a name="config-startParam"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-startParam" class="cls expand">startParam</a><span> : String</span></div><div class="description"><div class="short">The name of the 'start' parameter to send in a request. Defaults to 'start'. Set this
323 to undefined if you don't want ...</div><div class="long"><p>The name of the 'start' parameter to send in a request. Defaults to 'start'. Set this
324 to undefined if you don't want to send a start parameter</p>
325 </div></div></div><div id="config-timeout" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-timeout" rel="config-timeout" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-timeout" class="viewSource">view source</a></div><a name="timeout"></a><a name="config-timeout"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-timeout" class="cls expand">timeout</a><span> : Number</span></div><div class="description"><div class="short"><p>(optional) The number of milliseconds to wait for a response. Defaults to 30 seconds.</p>
326 </div><div class="long"><p>(optional) The number of milliseconds to wait for a response. Defaults to 30 seconds.</p>
327 </div></div></div><div id="config-url" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-url" rel="config-url" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-url" class="viewSource">view source</a></div><a name="url"></a><a name="config-url"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-url" class="cls expand">url</a><span> : String</span></div><div class="description"><div class="short"><p>The URL from which to request the data object.</p>
328 </div><div class="long"><p>The URL from which to request the data object.</p>
329 </div></div></div><div id="config-writer" class="member inherited"><a href="Ext.data.proxy.JsonP.html#config-writer" rel="config-writer" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-cfg-writer" class="viewSource">view source</a></div><a name="writer"></a><a name="config-writer"></a><a href="Ext.data.proxy.JsonP.html#" rel="config-writer" class="cls expand">writer</a><span> : Object/String/Ext.data.writer.Writer</span></div><div class="description"><div class="short">The Ext.data.writer.Writer to use to encode any request sent to the server.
330 This can either be a Writer instance, a c...</div><div class="long"><p>The <a href="Ext.data.writer.Writer.html" rel="Ext.data.writer.Writer" class="docClass">Ext.data.writer.Writer</a> to use to encode any request sent to the server.
331 This can either be a Writer instance, a config object or just a valid Writer type name (e.g. 'json', 'xml').</p>
332 </div></div></div></div><div class="m-properties"><a name="properties"></a><div class="definedBy">Defined By</div><h3 class="prp p">Properties</h3><div id="property-afterRequest" class="member f inherited"><a href="Ext.data.proxy.JsonP.html#property-afterRequest" rel="property-afterRequest" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-property-afterRequest" class="viewSource">view source</a></div><a name="afterRequest"></a><a name="property-afterRequest"></a><a href="Ext.data.proxy.JsonP.html#" rel="property-afterRequest" class="cls expand">afterRequest</a><span> : Object</span></div><div class="description"><div class="short"><p>Optional callback function which can be used to clean up after a request has been completed.</p>
333 </div><div class="long"><p>Optional callback function which can be used to clean up after a request has been completed.</p>
334 </div></div></div><div id="property-create" class="member inherited"><a href="Ext.data.proxy.JsonP.html#property-create" rel="property-create" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-property-create" class="viewSource">view source</a></div><a name="create"></a><a name="property-create"></a><a href="Ext.data.proxy.JsonP.html#" rel="property-create" class="cls expand">create</a><span> : Object</span></div><div class="description"><div class="short"><p>Performs the given create operation.</p>
335 </div><div class="long"><p>Performs the given create operation.</p>
336 </div></div></div><div id="property-destroy" class="member inherited"><a href="Ext.data.proxy.JsonP.html#property-destroy" rel="property-destroy" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-property-destroy" class="viewSource">view source</a></div><a name="destroy"></a><a name="property-destroy"></a><a href="Ext.data.proxy.JsonP.html#" rel="property-destroy" class="cls expand">destroy</a><span> : Object</span></div><div class="description"><div class="short"><p>Performs the given destroy operation.</p>
337 </div><div class="long"><p>Performs the given destroy operation.</p>
338 </div></div></div><div id="property-read" class="member inherited"><a href="Ext.data.proxy.JsonP.html#property-read" rel="property-read" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-property-read" class="viewSource">view source</a></div><a name="read"></a><a name="property-read"></a><a href="Ext.data.proxy.JsonP.html#" rel="property-read" class="cls expand">read</a><span> : Object</span></div><div class="description"><div class="short"><p>Performs the given read operation.</p>
339 </div><div class="long"><p>Performs the given read operation.</p>
340 </div></div></div><div id="property-update" class="member inherited"><a href="Ext.data.proxy.JsonP.html#property-update" rel="property-update" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-property-update" class="viewSource">view source</a></div><a name="update"></a><a name="property-update"></a><a href="Ext.data.proxy.JsonP.html#" rel="property-update" class="cls expand">update</a><span> : Object</span></div><div class="description"><div class="short"><p>Performs the given update operation.</p>
341 </div><div class="long"><p>Performs the given update operation.</p>
342 </div></div></div></div><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-JsonP" class="member f inherited"><a href="Ext.data.proxy.JsonP.html#method-JsonP" rel="method-JsonP" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-method-constructor" class="viewSource">view source</a></div><a name="JsonP"></a><a name="method-JsonP"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-JsonP" class="cls expand">JsonP</a>(
343 <span class="pre">Object config</span>)
344  : void</div><div class="description"><div class="short"><p>Creates the Proxy</p>
345 </div><div class="long"><p>Creates the Proxy</p>
346 <h3 class="pa">Parameters</h3><ul><li><span class="pre">config</span> : Object<div class="sub-desc"><p>Optional config object</p>
347 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
348 </li></ul></div></div></div><div id="method-abort" class="member ni"><a href="Ext.data.proxy.JsonP.html#method-abort" rel="method-abort" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.JsonP.html" class="definedIn docClass">Ext.data.proxy.JsonP</a><br/><a href="../source/JsonP2.html#Ext-data.proxy.JsonP-method-abort" class="viewSource">view source</a></div><a name="abort"></a><a name="method-abort"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-abort" class="cls expand">abort</a> : void</div><div class="description"><div class="short"><p>Aborts the current server request if one is currently running</p>
349 </div><div class="long"><p>Aborts the current server request if one is currently running</p>
350 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
351 </li></ul></div></div></div><div id="method-addEvents" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-addEvents" rel="method-addEvents" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-addEvents" class="viewSource">view source</a></div><a name="addEvents"></a><a name="method-addEvents"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-addEvents" class="cls expand">addEvents</a>(
352 <span class="pre">Object/String o, String </span>)
353  : void</div><div class="description"><div class="short"><p>Adds the specified events to the list of events which this Observable may fire.</p>
354 </div><div class="long"><p>Adds the specified events to the list of events which this Observable may fire.</p>
355 <h3 class="pa">Parameters</h3><ul><li><span class="pre">o</span> : Object/String<div class="sub-desc"><p>Either an object with event names as properties with a value of <code>true</code>
356 or the first event name string if multiple event names are being passed as separate parameters.</p>
357 </div></li><li><span class="pre"></span> : String<div class="sub-desc"><p>[additional] Optional additional event names if multiple event names are being passed as separate parameters.
358 Usage:</p>
359
360 <pre><code>this.addEvents('storeloaded', 'storecleared');
361 </code></pre>
362
363 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
364 </li></ul></div></div></div><div id="method-addListener" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-addListener" rel="method-addListener" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-addListener" class="viewSource">view source</a></div><a name="addListener"></a><a name="method-addListener"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-addListener" class="cls expand">addListener</a>(
365 <span class="pre">String eventName, Function handler, [Object scope], [Object options]</span>)
366  : void</div><div class="description"><div class="short"><p>Appends an event handler to this object.</p>
367 </div><div class="long"><p>Appends an event handler to this object.</p>
368 <h3 class="pa">Parameters</h3><ul><li><span class="pre">eventName</span> : String<div class="sub-desc"><p>The name of the event to listen for. May also be an object who's property names are event names. See</p>
369 </div></li><li><span class="pre">handler</span> : Function<div class="sub-desc"><p>The method the event invokes.</p>
370 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
371 <b>If omitted, defaults to the object which fired the event.</b></p>
372 </div></li><li><span class="pre">options</span> : Object<div class="sub-desc"><p>(optional) An object containing handler configuration.
373 properties. This may contain any of the following properties:<ul>
374 <li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
375 <b>If omitted, defaults to the object which fired the event.</b></div></li>
376 <li><b>delay</b> : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
377 <li><b>single</b> : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
378 <li><b>buffer</b> : Number<div class="sub-desc">Causes the handler to be scheduled to run in an <a href="Ext.util.DelayedTask.html" rel="Ext.util.DelayedTask" class="docClass">Ext.util.DelayedTask</a> delayed
379 by the specified number of milliseconds. If the event fires again within that time, the original
380 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
381 <li><b>target</b> : Observable<div class="sub-desc">Only call the handler if the event was fired on the target Observable, <i>not</i>
382 if the event was bubbled up from a child Observable.</div></li>
383 <li><b>element</b> : String<div class="sub-desc"><b>This option is only valid for listeners bound to <a href="Ext.Component.html" rel="Ext.Component" class="docClass">Components</a>.</b>
384 The name of a Component property which references an element to add a listener to.</p>
385
386 <p>This option is useful during Component construction to add DOM event listeners to elements of <a href="Ext.Component.html" rel="Ext.Component" class="docClass">Components</a> which
387 will exist only after the Component is rendered. For example, to add a click listener to a Panel's body:
388 <pre><code>new Ext.panel.Panel({
389     title: 'The title',
390     listeners: {
391         click: this.handlePanelClick,
392         element: 'body'
393     }
394 });
395 </code></pre></p>
396
397
398 <p>When added in this way, the options available are the options applicable to <a href="Ext.core.Element.html#addListener" rel="Ext.core.Element#addListener" class="docClass">Ext.core.Element.addListener</a></p>
399
400
401 <p></div></li>
402 </ul><br></p>
403
404 <p>
405 <b>Combining Options</b><br>
406 Using the options argument, it is possible to combine different types of listeners:<br>
407 <br>
408 A delayed, one-time listener.
409 <pre><code>myPanel.on('hide', this.handleClick, this, {
410 single: true,
411 delay: 100
412 });</code></pre>
413 <p>
414 <b>Attaching multiple handlers in 1 call</b><br>
415 The method also allows for a single argument to be passed which is a config object containing properties
416 which specify multiple events. For example:
417 <pre><code>myGridPanel.on({
418     cellClick: this.onCellClick,
419     mouseover: this.onMouseOver,
420     mouseout: this.onMouseOut,
421     scope: this // Important. Ensure "this" is correct during handler execution
422 });
423 </code></pre>.
424 <p>
425
426 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
427 </li></ul></div></div></div><div id="method-addManagedListener" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-addManagedListener" rel="method-addManagedListener" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-addManagedListener" class="viewSource">view source</a></div><a name="addManagedListener"></a><a name="method-addManagedListener"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-addManagedListener" class="cls expand">addManagedListener</a>(
428 <span class="pre">Observable/Element item, Object/String ename, Function fn, Object scope, Object opt</span>)
429  : void</div><div class="description"><div class="short"><p>Adds listeners to any Observable object (or Element) which are automatically removed when this Component
430 is destroyed.
431
432 </div><div class="long"><p>Adds listeners to any Observable object (or Element) which are automatically removed when this Component
433 is destroyed.
434
435 <h3 class="pa">Parameters</h3><ul><li><span class="pre">item</span> : Observable/Element<div class="sub-desc"><p>The item to which to add a listener/listeners.</p>
436 </div></li><li><span class="pre">ename</span> : Object/String<div class="sub-desc"><p>The event name, or an object containing event name properties.</p>
437 </div></li><li><span class="pre">fn</span> : Function<div class="sub-desc"><p>Optional. If the <code>ename</code> parameter was an event name, this
438 is the handler function.</p>
439 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>Optional. If the <code>ename</code> parameter was an event name, this
440 is the scope (<code>this</code> reference) in which the handler function is executed.</p>
441 </div></li><li><span class="pre">opt</span> : Object<div class="sub-desc"><p>Optional. If the <code>ename</code> parameter was an event name, this
442 is the <a href="Ext.util.Observable.html#addListener" rel="Ext.util.Observable#addListener" class="docClass">addListener</a> options.</p>
443 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
444 </li></ul></div></div></div><div id="method-batch" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-batch" rel="method-batch" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-method-batch" class="viewSource">view source</a></div><a name="batch"></a><a name="method-batch"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-batch" class="cls expand">batch</a>(
445 <span class="pre">Object operations, Object listeners</span>)
446  : Ext.data.Batch</div><div class="description"><div class="short">Performs a batch of Operations, in the order specified by batchOrder. Used internally by
447 Ext.data.Store's sync method...</div><div class="long"><p>Performs a batch of <a href="Ext.data.Operation.html" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="Ext.data.proxy.JsonP.html#batchOrder" rel="Ext.data.proxy.JsonP#batchOrder" class="docClass">batchOrder</a>. Used internally by
448 <a href="Ext.data.Store.html" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="Ext.data.Store.html#sync" rel="Ext.data.Store#sync" class="docClass">sync</a> method. Example usage:</p>
449
450 <pre><code>myProxy.batch({
451     create : [myModel1, myModel2],
452     update : [myModel3],
453     destroy: [myModel4, myModel5]
454 });
455 </code></pre>
456
457
458 <p>Where the myModel* above are <a href="Ext.data.Model.html" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been
459 saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p>
460 <h3 class="pa">Parameters</h3><ul><li><span class="pre">operations</span> : Object<div class="sub-desc"><p>Object containing the Model instances to act upon, keyed by action name</p>
461 </div></li><li><span class="pre">listeners</span> : Object<div class="sub-desc"><p>Optional listeners object passed straight through to the Batch - see <a href="Ext.data.Batch.html" rel="Ext.data.Batch" class="docClass">Ext.data.Batch</a></p>
462 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.Batch</span>&nbsp; &nbsp;<p>The newly created <a href="Ext.data.Batch.html" rel="Ext.data.Batch" class="docClass">Ext.data.Batch</a> object</p>
463 </li></ul></div></div></div><div id="method-buildRequest" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-buildRequest" rel="method-buildRequest" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-method-buildRequest" class="viewSource">view source</a></div><a name="buildRequest"></a><a name="method-buildRequest"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-buildRequest" class="cls expand">buildRequest</a>(
464 <span class="pre">Ext.data.Operation operation</span>)
465  : Ext.data.Request</div><div class="description"><div class="short"><p>Creates and returns an <a href="Ext.data.Request.html" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object based on the options passed by the <a href="Ext.data.Store.html" rel="Ext.data.Store" class="docClass">Store</a>
466 that this Proxy is attached to.</p>
467 </div><div class="long"><p>Creates and returns an <a href="Ext.data.Request.html" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object based on the options passed by the <a href="Ext.data.Store.html" rel="Ext.data.Store" class="docClass">Store</a>
468 that this Proxy is attached to.</p>
469 <h3 class="pa">Parameters</h3><ul><li><span class="pre">operation</span> : Ext.data.Operation<div class="sub-desc"><p>The <a href="Ext.data.Operation.html" rel="Ext.data.Operation" class="docClass">Operation</a> object to execute</p>
470 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.Request</span>&nbsp; &nbsp;<p>The request object</p>
471 </li></ul></div></div></div><div id="method-buildUrl" class="member ni"><a href="Ext.data.proxy.JsonP.html#method-buildUrl" rel="method-buildUrl" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.JsonP.html" class="definedIn docClass">Ext.data.proxy.JsonP</a><br/><a href="../source/JsonP2.html#Ext-data.proxy.JsonP-method-buildUrl" class="viewSource">view source</a></div><a name="buildUrl"></a><a name="method-buildUrl"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-buildUrl" class="cls expand">buildUrl</a>(
472 <span class="pre">Ext.data.Request request</span>)
473  : String</div><div class="description"><div class="short"><p>Generates a url based on a given <a href="Ext.data.Request.html" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object. Adds the params and callback function name to the url</p>
474 </div><div class="long"><p>Generates a url based on a given <a href="Ext.data.Request.html" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object. Adds the params and callback function name to the url</p>
475 <h3 class="pa">Parameters</h3><ul><li><span class="pre">request</span> : Ext.data.Request<div class="sub-desc"><p>The request object</p>
476 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">String</span>&nbsp; &nbsp;<p>The url</p>
477 </li></ul></div></div></div><div id="method-capture" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-capture" rel="method-capture" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-capture" class="viewSource">view source</a></div><a name="capture"></a><a name="method-capture"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-capture" class="cls expand">capture</a>(
478 <span class="pre">Observable o, Function fn, [Object scope]</span>)
479  : void</div><div class="description"><div class="short">Starts capture on the specified Observable. All events will be passed
480 to the supplied function with the event name + ...</div><div class="long"><p>Starts capture on the specified Observable. All events will be passed
481 to the supplied function with the event name + standard signature of the event
482 <b>before</b> the event is fired. If the supplied function returns false,
483 the event will not fire.</p>
484 <h3 class="pa">Parameters</h3><ul><li><span class="pre">o</span> : Observable<div class="sub-desc"><p>The Observable to capture events from.</p>
485 </div></li><li><span class="pre">fn</span> : Function<div class="sub-desc"><p>The function to call when an event is fired.</p>
486 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>(optional) The scope (<code>this</code> reference) in which the function is executed. Defaults to the Observable firing the event.</p>
487 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
488 </li></ul></div></div></div><div id="method-clearListeners" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-clearListeners" rel="method-clearListeners" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-clearListeners" class="viewSource">view source</a></div><a name="clearListeners"></a><a name="method-clearListeners"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-clearListeners" class="cls expand">clearListeners</a> : void</div><div class="description"><div class="short"><p>Removes all listeners for this object including the managed listeners</p>
489 </div><div class="long"><p>Removes all listeners for this object including the managed listeners</p>
490 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
491 </li></ul></div></div></div><div id="method-clearManagedListeners" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-clearManagedListeners" rel="method-clearManagedListeners" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-clearManagedListeners" class="viewSource">view source</a></div><a name="clearManagedListeners"></a><a name="method-clearManagedListeners"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-clearManagedListeners" class="cls expand">clearManagedListeners</a> : void</div><div class="description"><div class="short"><p>Removes all managed listeners for this object.</p>
492 </div><div class="long"><p>Removes all managed listeners for this object.</p>
493 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
494 </li></ul></div></div></div><div id="method-doRequest" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-doRequest" rel="method-doRequest" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-method-doRequest" class="viewSource">view source</a></div><a name="doRequest"></a><a name="method-doRequest"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-doRequest" class="cls expand">doRequest</a>(
495 <span class="pre">Ext.data.Operation operation, Function callback, Object scope</span>)
496  : void</div><div class="description"><div class="short">In ServerProxy subclasses, the create, read, update and destroy methods all pass
497 through to doRequest. Each ServerPro...</div><div class="long"><p>In ServerProxy subclasses, the <a href="Ext.data.proxy.JsonP.html#create" rel="Ext.data.proxy.JsonP#create" class="docClass">create</a>, <a href="Ext.data.proxy.JsonP.html#read" rel="Ext.data.proxy.JsonP#read" class="docClass">read</a>, <a href="Ext.data.proxy.JsonP.html#update" rel="Ext.data.proxy.JsonP#update" class="docClass">update</a> and <a href="Ext.data.proxy.JsonP.html#destroy" rel="Ext.data.proxy.JsonP#destroy" class="docClass">destroy</a> methods all pass
498 through to doRequest. Each ServerProxy subclass must implement the doRequest method - see <a href="Ext.data.proxy.JsonP.html" rel="Ext.data.proxy.JsonP" class="docClass">Ext.data.proxy.JsonP</a>
499 and <a href="Ext.data.proxy.Ajax.html" rel="Ext.data.proxy.Ajax" class="docClass">Ext.data.proxy.Ajax</a> for examples. This method carries the same signature as each of the methods that delegate to it.</p>
500 <h3 class="pa">Parameters</h3><ul><li><span class="pre">operation</span> : Ext.data.Operation<div class="sub-desc"><p>The <a href="Ext.data.Operation.html" rel="Ext.data.Operation" class="docClass">Ext.data.Operation</a> object</p>
501 </div></li><li><span class="pre">callback</span> : Function<div class="sub-desc"><p>The callback function to call when the Operation has completed</p>
502 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>The scope in which to execute the callback</p>
503 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
504 </li></ul></div></div></div><div id="method-enableBubble" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-enableBubble" rel="method-enableBubble" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-enableBubble" class="viewSource">view source</a></div><a name="enableBubble"></a><a name="method-enableBubble"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-enableBubble" class="cls expand">enableBubble</a>(
505 <span class="pre">String/Array events</span>)
506  : void</div><div class="description"><div class="short">Enables events fired by this Observable to bubble up an owner hierarchy by calling
507 this.getBubbleTarget() if present....</div><div class="long"><p>Enables events fired by this Observable to bubble up an owner hierarchy by calling
508 <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p>
509
510
511 <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="Ext.Component.html#getBubbleTarget" rel="Ext.Component#getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default
512 implementation in <a href="Ext.Component.html" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to
513 access the required target more quickly.</p>
514
515
516 <p>Example:</p>
517
518
519 <pre><code>Ext.override(Ext.form.field.Base, {
520 //  Add functionality to Field&#39;s initComponent to enable the change event to bubble
521 initComponent : Ext.Function.createSequence(Ext.form.field.Base.prototype.initComponent, function() {
522     this.enableBubble('change');
523 }),
524
525 //  We know that we want Field&#39;s events to bubble directly to the FormPanel.
526 getBubbleTarget : function() {
527     if (!this.formPanel) {
528         this.formPanel = this.findParentByType('form');
529     }
530     return this.formPanel;
531 }
532 });
533
534 var myForm = new Ext.formPanel({
535 title: 'User Details',
536 items: [{
537     ...
538 }],
539 listeners: {
540     change: function() {
541         // Title goes red if form has been modified.
542         myForm.header.setStyle('color', 'red');
543     }
544 }
545 });
546 </code></pre>
547
548 <h3 class="pa">Parameters</h3><ul><li><span class="pre">events</span> : String/Array<div class="sub-desc"><p>The event name to bubble, or an Array of event names.</p>
549 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
550 </li></ul></div></div></div><div id="method-encodeFilters" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-encodeFilters" rel="method-encodeFilters" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-method-encodeFilters" class="viewSource">view source</a></div><a name="encodeFilters"></a><a name="method-encodeFilters"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-encodeFilters" class="cls expand">encodeFilters</a>(
551 <span class="pre">Array sorters</span>)
552  : String</div><div class="description"><div class="short">Encodes the array of Ext.util.Filter objects into a string to be sent in the request url. By default,
553 this simply JSO...</div><div class="long"><p>Encodes the array of <a href="Ext.util.Filter.html" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> objects into a string to be sent in the request url. By default,
554 this simply JSON-encodes the filter data</p>
555 <h3 class="pa">Parameters</h3><ul><li><span class="pre">sorters</span> : Array<div class="sub-desc"><p>The array of <a href="Ext.util.Filter.html" rel="Ext.util.Filter" class="docClass">Filter</a> objects</p>
556 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">String</span>&nbsp; &nbsp;<p>The encoded filters</p>
557 </li></ul></div></div></div><div id="method-encodeRecords" class="member ni"><a href="Ext.data.proxy.JsonP.html#method-encodeRecords" rel="method-encodeRecords" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.JsonP.html" class="definedIn docClass">Ext.data.proxy.JsonP</a><br/><a href="../source/JsonP2.html#Ext-data.proxy.JsonP-method-encodeRecords" class="viewSource">view source</a></div><a name="encodeRecords"></a><a name="method-encodeRecords"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-encodeRecords" class="cls expand">encodeRecords</a>(
558 <span class="pre">Array records</span>)
559  : String</div><div class="description"><div class="short">Encodes an array of records into a string suitable to be appended to the script src url. This is broken
560 out into its ...</div><div class="long"><p>Encodes an array of records into a string suitable to be appended to the script src url. This is broken
561 out into its own function so that it can be easily overridden.</p>
562 <h3 class="pa">Parameters</h3><ul><li><span class="pre">records</span> : Array<div class="sub-desc"><p>The records array</p>
563 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">String</span>&nbsp; &nbsp;<p>The encoded records string</p>
564 </li></ul></div></div></div><div id="method-encodeSorters" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-encodeSorters" rel="method-encodeSorters" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-method-encodeSorters" class="viewSource">view source</a></div><a name="encodeSorters"></a><a name="method-encodeSorters"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-encodeSorters" class="cls expand">encodeSorters</a>(
565 <span class="pre">Array sorters</span>)
566  : String</div><div class="description"><div class="short">Encodes the array of Ext.util.Sorter objects into a string to be sent in the request url. By default,
567 this simply JSO...</div><div class="long"><p>Encodes the array of <a href="Ext.util.Sorter.html" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> objects into a string to be sent in the request url. By default,
568 this simply JSON-encodes the sorter data</p>
569 <h3 class="pa">Parameters</h3><ul><li><span class="pre">sorters</span> : Array<div class="sub-desc"><p>The array of <a href="Ext.util.Sorter.html" rel="Ext.util.Sorter" class="docClass">Sorter</a> objects</p>
570 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">String</span>&nbsp; &nbsp;<p>The encoded sorters</p>
571 </li></ul></div></div></div><div id="method-fireEvent" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-fireEvent" rel="method-fireEvent" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-fireEvent" class="viewSource">view source</a></div><a name="fireEvent"></a><a name="method-fireEvent"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-fireEvent" class="cls expand">fireEvent</a>(
572 <span class="pre">String eventName, Object... args</span>)
573  : Boolean</div><div class="description"><div class="short">Fires the specified event with the passed parameters (minus the event name).
574
575
576 An event may be set to bubble up an Ob...</div><div class="long"><p>Fires the specified event with the passed parameters (minus the event name).</p>
577
578
579 <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="Ext.Component.html#getBubbleTarget" rel="Ext.Component#getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>)
580 by calling <a href="Ext.data.proxy.JsonP.html#enableBubble" rel="Ext.data.proxy.JsonP#enableBubble" class="docClass">enableBubble</a>.</p>
581
582 <h3 class="pa">Parameters</h3><ul><li><span class="pre">eventName</span> : String<div class="sub-desc"><p>The name of the event to fire.</p>
583 </div></li><li><span class="pre">args</span> : Object...<div class="sub-desc"><p>Variable number of parameters are passed to handlers.</p>
584 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>returns false if any of the handlers return false otherwise it returns true.</p>
585 </li></ul></div></div></div><div id="method-getModel" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-getModel" rel="method-getModel" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-method-getModel" class="viewSource">view source</a></div><a name="getModel"></a><a name="method-getModel"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-getModel" class="cls expand">getModel</a> : Ext.data.Model</div><div class="description"><div class="short"><p>Returns the model attached to this Proxy</p>
586 </div><div class="long"><p>Returns the model attached to this Proxy</p>
587 <h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.Model</span>&nbsp; &nbsp;<p>The model</p>
588 </li></ul></div></div></div><div id="method-getReader" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-getReader" rel="method-getReader" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-method-getReader" class="viewSource">view source</a></div><a name="getReader"></a><a name="method-getReader"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-getReader" class="cls expand">getReader</a> : Ext.data.reader.Reader</div><div class="description"><div class="short"><p>Returns the reader currently attached to this proxy instance</p>
589 </div><div class="long"><p>Returns the reader currently attached to this proxy instance</p>
590 <h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.reader.Reader</span>&nbsp; &nbsp;<p>The Reader instance</p>
591 </li></ul></div></div></div><div id="method-getWriter" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-getWriter" rel="method-getWriter" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-method-getWriter" class="viewSource">view source</a></div><a name="getWriter"></a><a name="method-getWriter"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-getWriter" class="cls expand">getWriter</a> : Ext.data.writer.Writer</div><div class="description"><div class="short"><p>Returns the writer currently attached to this proxy instance</p>
592 </div><div class="long"><p>Returns the writer currently attached to this proxy instance</p>
593 <h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.writer.Writer</span>&nbsp; &nbsp;<p>The Writer instance</p>
594 </li></ul></div></div></div><div id="method-hasListener" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-hasListener" rel="method-hasListener" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-hasListener" class="viewSource">view source</a></div><a name="hasListener"></a><a name="method-hasListener"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-hasListener" class="cls expand">hasListener</a>(
595 <span class="pre">String eventName</span>)
596  : Boolean</div><div class="description"><div class="short"><p>Checks to see if this object has any listeners for a specified event</p>
597 </div><div class="long"><p>Checks to see if this object has any listeners for a specified event</p>
598 <h3 class="pa">Parameters</h3><ul><li><span class="pre">eventName</span> : String<div class="sub-desc"><p>The name of the event to check for</p>
599 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Boolean</span>&nbsp; &nbsp;<p>True if the event is being listened for, else false</p>
600 </li></ul></div></div></div><div id="method-observe" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-observe" rel="method-observe" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-observe" class="viewSource">view source</a></div><a name="observe"></a><a name="method-observe"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-observe" class="cls expand">observe</a>(
601 <span class="pre">Function c, Object listeners</span>)
602  : void</div><div class="description"><div class="short">Sets observability on the passed class constructor.
603
604 This makes any event fired on any instance of the passed class a...</div><div class="long"><p>Sets observability on the passed class constructor.</p>
605
606 <p>This makes any event fired on any instance of the passed class also fire a single event through
607 the <strong>class</strong> allowing for central handling of events on many instances at once.</p>
608
609 <p>Usage:</p>
610
611 <pre><code>Ext.util.Observable.observe(Ext.data.Connection);
612 Ext.data.Connection.on('beforerequest', function(con, options) {
613     console.log('Ajax request made to ' + options.url);
614 });
615 </code></pre>
616 <h3 class="pa">Parameters</h3><ul><li><span class="pre">c</span> : Function<div class="sub-desc"><p>The class constructor to make observable.</p>
617 </div></li><li><span class="pre">listeners</span> : Object<div class="sub-desc"><p>An object containing a series of listeners to add. See <a href="Ext.data.proxy.JsonP.html#addListener" rel="Ext.data.proxy.JsonP#addListener" class="docClass">addListener</a>.</p>
618 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
619 </li></ul></div></div></div><div id="method-on" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-on" rel="method-on" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-on" class="viewSource">view source</a></div><a name="on"></a><a name="method-on"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-on" class="cls expand">on</a>(
620 <span class="pre">String eventName, Function handler, [Object scope], [Object options]</span>)
621  : void</div><div class="description"><div class="short"><p>Appends an event handler to this object (shorthand for <a href="Ext.data.proxy.JsonP.html#addListener" rel="Ext.data.proxy.JsonP#addListener" class="docClass">addListener</a>.)</p>
622 </div><div class="long"><p>Appends an event handler to this object (shorthand for <a href="Ext.data.proxy.JsonP.html#addListener" rel="Ext.data.proxy.JsonP#addListener" class="docClass">addListener</a>.)</p>
623 <h3 class="pa">Parameters</h3><ul><li><span class="pre">eventName</span> : String<div class="sub-desc"><p>The type of event to listen for</p>
624 </div></li><li><span class="pre">handler</span> : Function<div class="sub-desc"><p>The method the event invokes</p>
625 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
626 <b>If omitted, defaults to the object which fired the event.</b></p>
627 </div></li><li><span class="pre">options</span> : Object<div class="sub-desc"><p>(optional) An object containing handler configuration.</p>
628 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
629 </li></ul></div></div></div><div id="method-processResponse" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-processResponse" rel="method-processResponse" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-method-processResponse" class="viewSource">view source</a></div><a name="processResponse"></a><a name="method-processResponse"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-processResponse" class="cls expand">processResponse</a>(
630 <span class="pre">Object success, Object operation, Object request, Object response, Object callback, Object scope</span>)
631  : void</div><div class="description"><div class="short"><p>&nbsp;</p></div><div class="long">
632 <h3 class="pa">Parameters</h3><ul><li><span class="pre">success</span> : Object<div class="sub-desc">
633 </div></li><li><span class="pre">operation</span> : Object<div class="sub-desc">
634 </div></li><li><span class="pre">request</span> : Object<div class="sub-desc">
635 </div></li><li><span class="pre">response</span> : Object<div class="sub-desc">
636 </div></li><li><span class="pre">callback</span> : Object<div class="sub-desc">
637 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc">
638 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
639 </li></ul></div></div></div><div id="method-relayEvents" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-relayEvents" rel="method-relayEvents" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-relayEvents" class="viewSource">view source</a></div><a name="relayEvents"></a><a name="method-relayEvents"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-relayEvents" class="cls expand">relayEvents</a>(
640 <span class="pre">Object origin, Array events, Object prefix</span>)
641  : void</div><div class="description"><div class="short"><p>Relays selected events from the specified Observable as if the events were fired by <code><b>this</b></code>.</p>
642 </div><div class="long"><p>Relays selected events from the specified Observable as if the events were fired by <code><b>this</b></code>.</p>
643 <h3 class="pa">Parameters</h3><ul><li><span class="pre">origin</span> : Object<div class="sub-desc"><p>The Observable whose events this object is to relay.</p>
644 </div></li><li><span class="pre">events</span> : Array<div class="sub-desc"><p>Array of event names to relay.</p>
645 </div></li><li><span class="pre">prefix</span> : Object<div class="sub-desc">
646 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
647 </li></ul></div></div></div><div id="method-releaseCapture" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-releaseCapture" rel="method-releaseCapture" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-releaseCapture" class="viewSource">view source</a></div><a name="releaseCapture"></a><a name="method-releaseCapture"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-releaseCapture" class="cls expand">releaseCapture</a>(
648 <span class="pre">Observable o</span>)
649  : void</div><div class="description"><div class="short"><p>Removes <b>all</b> added captures from the Observable.</p>
650 </div><div class="long"><p>Removes <b>all</b> added captures from the Observable.</p>
651 <h3 class="pa">Parameters</h3><ul><li><span class="pre">o</span> : Observable<div class="sub-desc"><p>The Observable to release</p>
652 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
653 </li></ul></div></div></div><div id="method-removeListener" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-removeListener" rel="method-removeListener" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-removeListener" class="viewSource">view source</a></div><a name="removeListener"></a><a name="method-removeListener"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-removeListener" class="cls expand">removeListener</a>(
654 <span class="pre">String eventName, Function handler, [Object scope]</span>)
655  : void</div><div class="description"><div class="short"><p>Removes an event handler.</p>
656 </div><div class="long"><p>Removes an event handler.</p>
657 <h3 class="pa">Parameters</h3><ul><li><span class="pre">eventName</span> : String<div class="sub-desc"><p>The type of event the handler was associated with.</p>
658 </div></li><li><span class="pre">handler</span> : Function<div class="sub-desc"><p>The handler to remove. <b>This must be a reference to the function passed into the <a href="Ext.data.proxy.JsonP.html#addListener" rel="Ext.data.proxy.JsonP#addListener" class="docClass">addListener</a> call.</b></p>
659 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>(optional) The scope originally specified for the handler.</p>
660 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
661 </li></ul></div></div></div><div id="method-removeManagedListener" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-removeManagedListener" rel="method-removeManagedListener" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-removeManagedListener" class="viewSource">view source</a></div><a name="removeManagedListener"></a><a name="method-removeManagedListener"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-removeManagedListener" class="cls expand">removeManagedListener</a>(
662 <span class="pre">Observable|Element item, Object|String ename, Function fn, Object scope</span>)
663  : void</div><div class="description"><div class="short"><p>Removes listeners that were added by the <a href="Ext.data.proxy.JsonP.html#mon" rel="Ext.data.proxy.JsonP#mon" class="docClass">mon</a> method.</p>
664 </div><div class="long"><p>Removes listeners that were added by the <a href="Ext.data.proxy.JsonP.html#mon" rel="Ext.data.proxy.JsonP#mon" class="docClass">mon</a> method.</p>
665 <h3 class="pa">Parameters</h3><ul><li><span class="pre">item</span> : Observable|Element<div class="sub-desc"><p>The item from which to remove a listener/listeners.</p>
666 </div></li><li><span class="pre">ename</span> : Object|String<div class="sub-desc"><p>The event name, or an object containing event name properties.</p>
667 </div></li><li><span class="pre">fn</span> : Function<div class="sub-desc"><p>Optional. If the <code>ename</code> parameter was an event name, this
668 is the handler function.</p>
669 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>Optional. If the <code>ename</code> parameter was an event name, this
670 is the scope (<code>this</code> reference) in which the handler function is executed.</p>
671 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
672 </li></ul></div></div></div><div id="method-resumeEvents" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-resumeEvents" rel="method-resumeEvents" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-resumeEvents" class="viewSource">view source</a></div><a name="resumeEvents"></a><a name="method-resumeEvents"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-resumeEvents" class="cls expand">resumeEvents</a> : void</div><div class="description"><div class="short">Resume firing events. (see suspendEvents)
673 If events were suspended using the queueSuspended parameter, then all
674 event...</div><div class="long"><p>Resume firing events. (see <a href="Ext.data.proxy.JsonP.html#suspendEvents" rel="Ext.data.proxy.JsonP#suspendEvents" class="docClass">suspendEvents</a>)
675 If events were suspended using the <code><b>queueSuspended</b></code> parameter, then all
676 events fired during event suspension will be sent to any listeners now.</p>
677 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
678 </li></ul></div></div></div><div id="method-setModel" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-setModel" rel="method-setModel" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-method-setModel" class="viewSource">view source</a></div><a name="setModel"></a><a name="method-setModel"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-setModel" class="cls expand">setModel</a>(
679 <span class="pre">String|Ext.data.Model model, Boolean setOnStore</span>)
680  : void</div><div class="description"><div class="short"><p>Sets the model associated with this proxy. This will only usually be called by a Store</p>
681 </div><div class="long"><p>Sets the model associated with this proxy. This will only usually be called by a Store</p>
682 <h3 class="pa">Parameters</h3><ul><li><span class="pre">model</span> : String|Ext.data.Model<div class="sub-desc"><p>The new model. Can be either the model name string,
683 or a reference to the model's constructor</p>
684 </div></li><li><span class="pre">setOnStore</span> : Boolean<div class="sub-desc"><p>Sets the new model on the associated Store, if one is present</p>
685 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
686 </li></ul></div></div></div><div id="method-setReader" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-setReader" rel="method-setReader" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-method-setReader" class="viewSource">view source</a></div><a name="setReader"></a><a name="method-setReader"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-setReader" class="cls expand">setReader</a>(
687 <span class="pre">String|Object|Ext.data.reader.Reader reader</span>)
688  : Ext.data.reader.Reader</div><div class="description"><div class="short"><p>Sets the Proxy's Reader by string, config object or Reader instance</p>
689 </div><div class="long"><p>Sets the Proxy's Reader by string, config object or Reader instance</p>
690 <h3 class="pa">Parameters</h3><ul><li><span class="pre">reader</span> : String|Object|Ext.data.reader.Reader<div class="sub-desc"><p>The new Reader, which can be either a type string, a configuration object
691 or an <a href="Ext.data.reader.Reader.html" rel="Ext.data.reader.Reader" class="docClass">Ext.data.reader.Reader</a> instance</p>
692 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.reader.Reader</span>&nbsp; &nbsp;<p>The attached Reader object</p>
693 </li></ul></div></div></div><div id="method-setWriter" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-setWriter" rel="method-setWriter" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Proxy.html" class="definedIn docClass">Ext.data.proxy.Proxy</a><br/><a href="../source/Proxy2.html#Ext-data.proxy.Proxy-method-setWriter" class="viewSource">view source</a></div><a name="setWriter"></a><a name="method-setWriter"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-setWriter" class="cls expand">setWriter</a>(
694 <span class="pre">String|Object|Ext.data.writer.Writer writer</span>)
695  : Ext.data.writer.Writer</div><div class="description"><div class="short"><p>Sets the Proxy's Writer by string, config object or Writer instance</p>
696 </div><div class="long"><p>Sets the Proxy's Writer by string, config object or Writer instance</p>
697 <h3 class="pa">Parameters</h3><ul><li><span class="pre">writer</span> : String|Object|Ext.data.writer.Writer<div class="sub-desc"><p>The new Writer, which can be either a type string, a configuration object
698 or an <a href="Ext.data.writer.Writer.html" rel="Ext.data.writer.Writer" class="docClass">Ext.data.writer.Writer</a> instance</p>
699 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.writer.Writer</span>&nbsp; &nbsp;<p>The attached Writer object</p>
700 </li></ul></div></div></div><div id="method-suspendEvents" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-suspendEvents" rel="method-suspendEvents" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-suspendEvents" class="viewSource">view source</a></div><a name="suspendEvents"></a><a name="method-suspendEvents"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-suspendEvents" class="cls expand">suspendEvents</a>(
701 <span class="pre">Boolean queueSuspended</span>)
702  : void</div><div class="description"><div class="short"><p>Suspend the firing of all events. (see <a href="Ext.data.proxy.JsonP.html#resumeEvents" rel="Ext.data.proxy.JsonP#resumeEvents" class="docClass">resumeEvents</a>)</p>
703 </div><div class="long"><p>Suspend the firing of all events. (see <a href="Ext.data.proxy.JsonP.html#resumeEvents" rel="Ext.data.proxy.JsonP#resumeEvents" class="docClass">resumeEvents</a>)</p>
704 <h3 class="pa">Parameters</h3><ul><li><span class="pre">queueSuspended</span> : Boolean<div class="sub-desc"><p>Pass as true to queue up suspended events to be fired
705 after the <a href="Ext.data.proxy.JsonP.html#resumeEvents" rel="Ext.data.proxy.JsonP#resumeEvents" class="docClass">resumeEvents</a> call instead of discarding all suspended events;</p>
706 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
707 </li></ul></div></div></div><div id="method-un" class="member inherited"><a href="Ext.data.proxy.JsonP.html#method-un" rel="method-un" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Observable.html" class="definedIn docClass">Ext.util.Observable</a><br/><a href="../source/Observable.html#Ext-util.Observable-method-un" class="viewSource">view source</a></div><a name="un"></a><a name="method-un"></a><a href="Ext.data.proxy.JsonP.html#" rel="method-un" class="cls expand">un</a>(
708 <span class="pre">String eventName, Function handler, [Object scope]</span>)
709  : void</div><div class="description"><div class="short"><p>Removes an event handler (shorthand for <a href="Ext.data.proxy.JsonP.html#removeListener" rel="Ext.data.proxy.JsonP#removeListener" class="docClass">removeListener</a>.)</p>
710 </div><div class="long"><p>Removes an event handler (shorthand for <a href="Ext.data.proxy.JsonP.html#removeListener" rel="Ext.data.proxy.JsonP#removeListener" class="docClass">removeListener</a>.)</p>
711 <h3 class="pa">Parameters</h3><ul><li><span class="pre">eventName</span> : String<div class="sub-desc"><p>The type of event the handler was associated with.</p>
712 </div></li><li><span class="pre">handler</span> : Function<div class="sub-desc"><p>The handler to remove. <b>This must be a reference to the function passed into the <a href="Ext.data.proxy.JsonP.html#addListener" rel="Ext.data.proxy.JsonP#addListener" class="docClass">addListener</a> call.</b></p>
713 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>(optional) The scope originally specified for the handler.</p>
714 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
715 </li></ul></div></div></div></div><div class="m-events"><a name="events"></a><div class="definedBy">Defined By</div><h3 class="evt p">Events</h3><div id="event-exception" class="member f ni"><a href="Ext.data.proxy.JsonP.html#event-exception" rel="event-exception" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.JsonP.html" class="definedIn docClass">Ext.data.proxy.JsonP</a><br/><a href="../source/JsonP2.html#Ext-data.proxy.JsonP-event-exception" class="viewSource">view source</a></div><a name="exception"></a><a name="event-exception"></a><a href="Ext.data.proxy.JsonP.html#" rel="event-exception" class="cls expand">exception</a>(
716 <span class="pre">Ext.data.proxy.Proxy this, Ext.data.Request request, Ext.data.Operation operation</span>)
717 </div><div class="description"><div class="short"><p>Fires when the server returns an exception</p>
718 </div><div class="long"><p>Fires when the server returns an exception</p>
719 <h3 class="pa">Parameters</h3><ul><li><span class="pre">this</span> : Ext.data.proxy.Proxy<div class="sub-desc">
720 </div></li><li><span class="pre">request</span> : Ext.data.Request<div class="sub-desc"><p>The request that was sent</p>
721 </div></li><li><span class="pre">operation</span> : Ext.data.Operation<div class="sub-desc"><p>The operation that triggered the request</p>
722 </div></li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>