Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / api / Ext.data.proxy.Rest.html
1 <!DOCTYPE html><html><head><title>Ext.data.proxy.Rest | 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.Rest',
13         docClass: 'Ext.data.proxy.Rest',
14         docReq: 'Ext.data.proxy.Rest',
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 = 'Rest.html#Ext-data.proxy.Rest';
33     clsInfo = {"methods":["Rest","addEvents","addListener","addManagedListener","batch","buildRequest","buildUrl","capture","clearListeners","clearManagedListeners","doRequest","enableBubble","encodeFilters","encodeSorters","fireEvent","getMethod","getModel","getReader","getWriter","hasListener","observe","on","processResponse","relayEvents","releaseCapture","removeListener","removeManagedListener","resumeEvents","setModel","setReader","setWriter","suspendEvents","un"],"cfgs":["api","appendId","batchActions","batchOrder","cacheString","directionParam","extraParams","filterParam","format","groupParam","headers","limitParam","listeners","model","noCache","pageParam","reader","simpleSortMode","sortParam","startParam","timeout","url","writer"],"properties":["actionMethods","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/Rest.html#Ext-data.proxy.Rest" target="_blank">Ext.data.proxy.Rest</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"><a href="Ext.data.proxy.Ajax.html" rel="Ext.data.proxy.Ajax" class="cls docClass">Ext.data.proxy.Ajax</a><div class="subclass"><strong>Ext.data.proxy.Rest</strong></div></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>RestProxy is a specialization of the <a href="Ext.data.proxy.Ajax.html" rel="Ext.data.proxy.Ajax" class="docClass">AjaxProxy</a> which simply maps the four actions 
38 (create, read, update and destroy) to RESTful HTTP verbs. For example, let's set up a <a href="Ext.data.Model.html" rel="Ext.data.Model" class="docClass">Model</a>
39 with an inline RestProxy</p>
40
41
42
43
44 <pre class="prettyprint"><code>Ext.define('User', {
45     extend: 'Ext.data.Model',
46     fields: ['id', 'name', 'email'],
47
48     proxy: {
49         type: 'rest',
50         url : '/users'
51     }
52 });
53 </code></pre>
54
55
56
57
58 <p>Now we can create a new User instance and save it via the RestProxy. Doing this will cause the Proxy to send a
59 POST request to '/users':
60
61 <pre class="prettyprint"><code>var user = Ext.ModelManager.create({name: 'Ed Spencer', email: 'ed@sencha.com'}, 'User');
62
63 user.save(); //POST /users
64 </code></pre>
65
66 <p>Let's expand this a little and provide a callback for the <a href="Ext.data.Model.html#save" rel="Ext.data.Model#save" class="docClass">Ext.data.Model.save</a> call to update the Model
67 once it has been created. We'll assume the creation went successfully and that the server gave this user an ID of 
68 123:</p>
69
70 <pre class="prettyprint"><code>user.save({
71     success: function(user) {
72         user.set('name', 'Khan Noonien Singh');
73
74         user.save(); //PUT /users/123
75     }
76 });
77 </code></pre>
78
79 <p>Now that we're no longer creating a new Model instance, the request method is changed to an HTTP PUT, targeting
80 the relevant url for that user. Now let's delete this user, which will use the DELETE method:</p>
81
82 <pre class="prettyprint"><code>    user.destroy(); //DELETE /users/123
83 </code></pre>
84
85 <p>Finally, when we perform a load of a Model or Store, RestProxy will use the GET method:</p>
86
87 <pre class="prettyprint"><code>//1. Load via Store
88
89 //the Store automatically picks up the Proxy from the User model
90 var store = new Ext.data.Store({
91     model: 'User'
92 });
93
94 store.load(); //GET /users
95
96 //2. Load directly from the Model
97
98 //GET /users/123
99 Ext.ModelManager.getModel('User').load(123, {
100     success: function(user) {
101         console.log(user.getId()); //outputs 123
102     }
103 });
104 </code></pre>
105
106 <p><u>Url generation</u></p>
107
108 <p>RestProxy is able to automatically generate the urls above based on two configuration options - <a href="Ext.data.proxy.Rest.html#appendId" rel="Ext.data.proxy.Rest#appendId" class="docClass">appendId</a>
109 and <a href="Ext.data.proxy.Rest.html#format" rel="Ext.data.proxy.Rest#format" class="docClass">format</a>. If appendId is true (it is by default) then RestProxy will automatically append the ID of the 
110 Model instance in question to the configured url, resulting in the '/users/123' that we saw above.</p>
111
112 <p>If the request is not for a specific Model instance (e.g. loading a Store), the url is not appended with an id. 
113 RestProxy will automatically insert a '/' before the ID if one is not already present.</p>
114
115 <pre class="prettyprint"><code>new Ext.data.proxy.Rest({
116     url: '/users',
117     appendId: true //default
118 });
119
120 // Collection url: /users
121 // Instance url  : /users/123
122 </code></pre>
123
124 <p>RestProxy can also optionally append a format string to the end of any generated url:</p>
125
126 <pre class="prettyprint"><code>new Ext.data.proxy.Rest({
127     url: '/users',
128     format: 'json'
129 });
130
131 // Collection url: /users.json
132 // Instance url  : /users/123.json
133 </code></pre>
134
135 <p>If further customization is needed, simply implement the <a href="Ext.data.proxy.Rest.html#buildUrl" rel="Ext.data.proxy.Rest#buildUrl" class="docClass">buildUrl</a> method and add your custom generated
136 url onto the <a href="Ext.data.Request.html" rel="Ext.data.Request" class="docClass">Request</a> object that is passed to buildUrl. See 
137 <a href="source/RestProxy.html#method-Ext.data.proxy.Rest-buildUrl">RestProxy's implementation</a> for an example of
138 how to achieve this.</p>
139
140 <p>Note that RestProxy inherits from <a href="Ext.data.proxy.Ajax.html" rel="Ext.data.proxy.Ajax" class="docClass">AjaxProxy</a>, which already injects all of the sorter,
141 filter, group and paging options into the generated url. See the <a href="Ext.data.proxy.Ajax.html" rel="Ext.data.proxy.Ajax" class="docClass">AjaxProxy docs</a> for more
142 details.</p>
143
144 <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.Rest.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.Rest.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".
145 Defaults to:
146
147 api: {
148     read ...</div><div class="long"><p>Specific urls to call on CRUD action methods "read", "create", "update" and "destroy".
149 Defaults to:</p>
150
151 <pre><code>api: {
152     read    : undefined,
153     create  : undefined,
154     update  : undefined,
155     destroy : undefined
156 }
157 </code></pre>
158
159
160 <p>The url is built based upon the action being executed <tt>[load|create|save|destroy]</tt>
161 using the commensurate <tt><a href="Ext.data.proxy.Rest.html#api" rel="Ext.data.proxy.Rest#api" class="docClass">api</a></tt> property, or if undefined default to the
162 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>
163
164
165 <br>
166
167
168 <p>For example:</p>
169
170
171 <pre><code>api: {
172     load :    '/controller/load',
173     create :  '/controller/new',
174     save :    '/controller/update',
175     destroy : '/controller/destroy_action'
176 }
177 </code></pre>
178
179
180 <p>If the specific URL for a given CRUD action is undefined, the CRUD action request
181 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>
182
183 </div></div></div><div id="config-appendId" class="member ni"><a href="Ext.data.proxy.Rest.html#config-appendId" rel="config-appendId" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Rest.html" class="definedIn docClass">Ext.data.proxy.Rest</a><br/><a href="../source/Rest.html#Ext-data.proxy.Rest-cfg-appendId" class="viewSource">view source</a></div><a name="appendId"></a><a name="config-appendId"></a><a href="Ext.data.proxy.Rest.html#" rel="config-appendId" class="cls expand">appendId</a><span> : Boolean</span></div><div class="description"><div class="short">True to automatically append the ID of a Model instance when performing a request based
184 on that single instance. See ...</div><div class="long"><p>True to automatically append the ID of a Model instance when performing a request based
185 on that single instance. See RestProxy intro docs for more details. Defaults to true.</p>
186 </div></div></div><div id="config-batchActions" class="member ni"><a href="Ext.data.proxy.Rest.html#config-batchActions" rel="config-batchActions" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Rest.html" class="definedIn docClass">Ext.data.proxy.Rest</a><br/><a href="../source/Rest.html#Ext-data.proxy.Rest-cfg-batchActions" class="viewSource">view source</a></div><a name="batchActions"></a><a name="config-batchActions"></a><a href="Ext.data.proxy.Rest.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.
187 Defaults to <tt>false</tt>.</p>
188 </div><div class="long"><p>True to batch actions of a particular type when synchronizing the store.
189 Defaults to <tt>false</tt>.</p>
190 </div></div></div><div id="config-batchOrder" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
191 to set a different ord...</div><div class="long"><p>Comma-separated ordering 'create', 'update' and 'destroy' actions when batching. Override this
192 to set a different order for the batched CRUD actions to be executed in. Defaults to 'create,update,destroy'</p>
193 </div></div></div><div id="config-cacheString" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
194 </div><div class="long"><p>The name of the cache param added to the url when using noCache (defaults to "_dc")</p>
195 </div></div></div><div id="config-directionParam" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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.
196 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>
197 Defaults to 'dir'.</p>
198 </div></div></div><div id="config-extraParams" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
199 of the same name will overri...</div><div class="long"><p>Extra parameters that will be included on every request. Individual requests with params
200 of the same name will override these params when they are in conflict.</p>
201 </div></div></div><div id="config-filterParam" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
202 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
203 this to undefined if you don't want to send a filter parameter</p>
204 </div></div></div><div id="config-format" class="member ni"><a href="Ext.data.proxy.Rest.html#config-format" rel="config-format" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Rest.html" class="definedIn docClass">Ext.data.proxy.Rest</a><br/><a href="../source/Rest.html#Ext-data.proxy.Rest-cfg-format" class="viewSource">view source</a></div><a name="format"></a><a name="config-format"></a><a href="Ext.data.proxy.Rest.html#" rel="config-format" class="cls expand">format</a><span> : String</span></div><div class="description"><div class="short">Optional data format to send to the server when making any request (e.g. 'json'). See the
205 RestProxy intro docs for fu...</div><div class="long"><p>Optional data format to send to the server when making any request (e.g. 'json'). See the
206 RestProxy intro docs for full details. Defaults to undefined.</p>
207 </div></div></div><div id="config-groupParam" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
208 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
209 to undefined if you don't want to send a group parameter</p>
210 </div></div></div><div id="config-headers" class="member inherited"><a href="Ext.data.proxy.Rest.html#config-headers" rel="config-headers" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Ajax.html" class="definedIn docClass">Ext.data.proxy.Ajax</a><br/><a href="../source/Ajax2.html#Ext-data.proxy.Ajax-cfg-headers" class="viewSource">view source</a></div><a name="headers"></a><a name="config-headers"></a><a href="Ext.data.proxy.Rest.html#" rel="config-headers" class="cls expand">headers</a><span> : Object</span></div><div class="description"><div class="short"><p>Any headers to add to the Ajax request. Defaults to <tt>undefined</tt>.</p>
211 </div><div class="long"><p>Any headers to add to the Ajax request. Defaults to <tt>undefined</tt>.</p>
212 </div></div></div><div id="config-limitParam" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
213 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
214 to undefined if you don't want to send a limit parameter</p>
215 </div></div></div><div id="config-listeners" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
216 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
217 object during initialization.  This should be a valid listeners config object as specified in the
218 <a href="Ext.data.proxy.Rest.html#addListener" rel="Ext.data.proxy.Rest#addListener" class="docClass">addListener</a> example for attaching multiple handlers at once.</p></p>
219
220 <br><p><b><u>DOM events from ExtJs <a href="Ext.Component.html" rel="Ext.Component" class="docClass">Components</a></u></b></p>
221
222
223 <br><p>While <i>some</i> ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
224
225
226 <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
227 <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
228 events directly from a child element of a Component, we need to specify the <code>element</code> option to
229 identify the Component property to add a DOM listener to:</p>
230
231 <pre><code>new Ext.panel.Panel({
232     width: 400,
233     height: 200,
234     dockedItems: [{
235         xtype: 'toolbar'
236     }],
237     listeners: {
238         click: {
239             element: 'el', //bind to the underlying el property on the panel
240             fn: function(){ console.log('click el'); }
241         },
242         dblclick: {
243             element: 'body', //bind to the underlying body property on the panel
244             fn: function(){ console.log('dblclick body'); }
245         }
246     }
247 });
248 </code></pre>
249
250
251 <p></p></p>
252 </div></div></div><div id="config-model" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
253 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
254 the Model, or a reference to the Model constructor. Required.</p>
255 </div></div></div><div id="config-noCache" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
256 name to the request.</p>
257 </div><div class="long"><p>(optional) Defaults to true. Disable caching by adding a unique parameter
258 name to the request.</p>
259 </div></div></div><div id="config-pageParam" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
260 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
261 undefined if you don't want to send a page parameter</p>
262 </div></div></div><div id="config-reader" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
263 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
264 either be a Reader instance, a config object or just a valid Reader type name (e.g. 'json', 'xml').</p>
265 </div></div></div><div id="config-simpleSortMode" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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.
266 The directionParam and sortParam will be sent with the property name and either 'ASC' or 'DESC'</p>
267 </div></div></div><div id="config-sortParam" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
268 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
269 to undefined if you don't want to send a sort parameter</p>
270 </div></div></div><div id="config-startParam" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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
271 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
272 to undefined if you don't want to send a start parameter</p>
273 </div></div></div><div id="config-timeout" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
274 </div><div class="long"><p>(optional) The number of milliseconds to wait for a response. Defaults to 30 seconds.</p>
275 </div></div></div><div id="config-url" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
276 </div><div class="long"><p>The URL from which to request the data object.</p>
277 </div></div></div><div id="config-writer" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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.
278 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.
279 This can either be a Writer instance, a config object or just a valid Writer type name (e.g. 'json', 'xml').</p>
280 </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-actionMethods" class="member f ni"><a href="Ext.data.proxy.Rest.html#property-actionMethods" rel="property-actionMethods" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Rest.html" class="definedIn docClass">Ext.data.proxy.Rest</a><br/><a href="../source/Rest.html#Ext-data.proxy.Rest-property-actionMethods" class="viewSource">view source</a></div><a name="actionMethods"></a><a name="property-actionMethods"></a><a href="Ext.data.proxy.Rest.html#" rel="property-actionMethods" class="cls expand">actionMethods</a><span> : Object</span></div><div class="description"><div class="short">Mapping of action name to HTTP request method. These default to RESTful conventions for the 'create', 'read',
281 'update...</div><div class="long"><p>Mapping of action name to HTTP request method. These default to RESTful conventions for the 'create', 'read',
282 'update' and 'destroy' actions (which map to 'POST', 'GET', 'PUT' and 'DELETE' respectively). This object should
283 not be changed except globally via <a href="Ext.html#override" rel="Ext#override" class="docClass">Ext.override</a> - the <a href="Ext.data.proxy.Rest.html#getMethod" rel="Ext.data.proxy.Rest#getMethod" class="docClass">getMethod</a> function can be overridden instead.</p>
284 </div></div></div><div id="property-afterRequest" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
285 </div><div class="long"><p>Optional callback function which can be used to clean up after a request has been completed.</p>
286 </div></div></div><div id="property-create" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
287 </div><div class="long"><p>Performs the given create operation.</p>
288 </div></div></div><div id="property-destroy" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
289 </div><div class="long"><p>Performs the given destroy operation.</p>
290 </div></div></div><div id="property-read" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
291 </div><div class="long"><p>Performs the given read operation.</p>
292 </div></div></div><div id="property-update" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
293 </div><div class="long"><p>Performs the given update operation.</p>
294 </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-Rest" class="member f inherited"><a href="Ext.data.proxy.Rest.html#method-Rest" rel="method-Rest" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Ajax.html" class="definedIn docClass">Ext.data.proxy.Ajax</a><br/><a href="../source/Ajax2.html#Ext-data.proxy.Ajax-method-constructor" class="viewSource">view source</a></div><a name="Rest"></a><a name="method-Rest"></a><a href="Ext.data.proxy.Rest.html#" rel="method-Rest" class="cls expand">Rest</a> : void</div><div class="description"><div class="short">Note that if this HttpProxy is being used by a Store, then the
295 Store's call to load will override any specified callb...</div><div class="long"><p>Note that if this HttpProxy is being used by a <a href="Ext.data.Store.html" rel="Ext.data.Store" class="docClass">Store</a>, then the
296 Store's call to <a href="Ext.data.proxy.Rest.html#load" rel="Ext.data.proxy.Rest#load" class="docClass">load</a> will override any specified <tt>callback</tt> and <tt>params</tt>
297 options. In this case, use the Store's <a href="Ext.data.Store.html#events" rel="Ext.data.Store#events" class="docClass">events</a> to modify parameters,
298 or react to loading events. The Store's <a href="Ext.data.Store.html#baseParams" rel="Ext.data.Store#baseParams" class="docClass">baseParams</a> may also be
299 used to pass parameters known at instantiation time.</p>
300
301
302
303
304 <p>If an options parameter is passed, the singleton <a href="Ext.Ajax.html" rel="Ext.Ajax" class="docClass">Ext.Ajax</a> object will be used to make
305 the request.</p>
306
307 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
308 </li></ul></div></div></div><div id="method-addEvents" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-addEvents" class="cls expand">addEvents</a>(
309 <span class="pre">Object/String o, String </span>)
310  : void</div><div class="description"><div class="short"><p>Adds the specified events to the list of events which this Observable may fire.</p>
311 </div><div class="long"><p>Adds the specified events to the list of events which this Observable may fire.</p>
312 <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>
313 or the first event name string if multiple event names are being passed as separate parameters.</p>
314 </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.
315 Usage:</p>
316
317 <pre><code>this.addEvents('storeloaded', 'storecleared');
318 </code></pre>
319
320 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
321 </li></ul></div></div></div><div id="method-addListener" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-addListener" class="cls expand">addListener</a>(
322 <span class="pre">String eventName, Function handler, [Object scope], [Object options]</span>)
323  : void</div><div class="description"><div class="short"><p>Appends an event handler to this object.</p>
324 </div><div class="long"><p>Appends an event handler to this object.</p>
325 <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>
326 </div></li><li><span class="pre">handler</span> : Function<div class="sub-desc"><p>The method the event invokes.</p>
327 </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.
328 <b>If omitted, defaults to the object which fired the event.</b></p>
329 </div></li><li><span class="pre">options</span> : Object<div class="sub-desc"><p>(optional) An object containing handler configuration.
330 properties. This may contain any of the following properties:<ul>
331 <li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
332 <b>If omitted, defaults to the object which fired the event.</b></div></li>
333 <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>
334 <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>
335 <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
336 by the specified number of milliseconds. If the event fires again within that time, the original
337 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
338 <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>
339 if the event was bubbled up from a child Observable.</div></li>
340 <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>
341 The name of a Component property which references an element to add a listener to.</p>
342
343 <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
344 will exist only after the Component is rendered. For example, to add a click listener to a Panel's body:
345 <pre><code>new Ext.panel.Panel({
346     title: 'The title',
347     listeners: {
348         click: this.handlePanelClick,
349         element: 'body'
350     }
351 });
352 </code></pre></p>
353
354
355 <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>
356
357
358 <p></div></li>
359 </ul><br></p>
360
361 <p>
362 <b>Combining Options</b><br>
363 Using the options argument, it is possible to combine different types of listeners:<br>
364 <br>
365 A delayed, one-time listener.
366 <pre><code>myPanel.on('hide', this.handleClick, this, {
367 single: true,
368 delay: 100
369 });</code></pre>
370 <p>
371 <b>Attaching multiple handlers in 1 call</b><br>
372 The method also allows for a single argument to be passed which is a config object containing properties
373 which specify multiple events. For example:
374 <pre><code>myGridPanel.on({
375     cellClick: this.onCellClick,
376     mouseover: this.onMouseOver,
377     mouseout: this.onMouseOut,
378     scope: this // Important. Ensure "this" is correct during handler execution
379 });
380 </code></pre>.
381 <p>
382
383 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
384 </li></ul></div></div></div><div id="method-addManagedListener" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-addManagedListener" class="cls expand">addManagedListener</a>(
385 <span class="pre">Observable/Element item, Object/String ename, Function fn, Object scope, Object opt</span>)
386  : void</div><div class="description"><div class="short"><p>Adds listeners to any Observable object (or Element) which are automatically removed when this Component
387 is destroyed.
388
389 </div><div class="long"><p>Adds listeners to any Observable object (or Element) which are automatically removed when this Component
390 is destroyed.
391
392 <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>
393 </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>
394 </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
395 is the handler function.</p>
396 </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
397 is the scope (<code>this</code> reference) in which the handler function is executed.</p>
398 </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
399 is the <a href="Ext.util.Observable.html#addListener" rel="Ext.util.Observable#addListener" class="docClass">addListener</a> options.</p>
400 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
401 </li></ul></div></div></div><div id="method-batch" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-batch" class="cls expand">batch</a>(
402 <span class="pre">Object operations, Object listeners</span>)
403  : Ext.data.Batch</div><div class="description"><div class="short">Performs a batch of Operations, in the order specified by batchOrder. Used internally by
404 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.Rest.html#batchOrder" rel="Ext.data.proxy.Rest#batchOrder" class="docClass">batchOrder</a>. Used internally by
405 <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>
406
407 <pre><code>myProxy.batch({
408     create : [myModel1, myModel2],
409     update : [myModel3],
410     destroy: [myModel4, myModel5]
411 });
412 </code></pre>
413
414
415 <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
416 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>
417 <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>
418 </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>
419 </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>
420 </li></ul></div></div></div><div id="method-buildRequest" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-buildRequest" class="cls expand">buildRequest</a>(
421 <span class="pre">Ext.data.Operation operation</span>)
422  : 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>
423 that this Proxy is attached to.</p>
424 </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>
425 that this Proxy is attached to.</p>
426 <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>
427 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.Request</span>&nbsp; &nbsp;<p>The request object</p>
428 </li></ul></div></div></div><div id="method-buildUrl" class="member ni"><a href="Ext.data.proxy.Rest.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.Rest.html" class="definedIn docClass">Ext.data.proxy.Rest</a><br/><a href="../source/Rest.html#Ext-data.proxy.Rest-method-buildUrl" class="viewSource">view source</a></div><a name="buildUrl"></a><a name="method-buildUrl"></a><a href="Ext.data.proxy.Rest.html#" rel="method-buildUrl" class="cls expand">buildUrl</a>(
429 <span class="pre">Object request</span>)
430  : void</div><div class="description"><div class="short">Specialized version of buildUrl that incorporates the appendId and format options into the
431 generated url. Override th...</div><div class="long"><p>Specialized version of buildUrl that incorporates the <a href="Ext.data.proxy.Rest.html#appendId" rel="Ext.data.proxy.Rest#appendId" class="docClass">appendId</a> and <a href="Ext.data.proxy.Rest.html#format" rel="Ext.data.proxy.Rest#format" class="docClass">format</a> options into the
432 generated url. Override this to provide further customizations, but remember to call the superclass buildUrl
433 so that additional parameters like the cache buster string are appended</p>
434 <h3 class="pa">Parameters</h3><ul><li><span class="pre">request</span> : Object<div class="sub-desc">
435 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
436 </li></ul></div></div></div><div id="method-capture" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-capture" class="cls expand">capture</a>(
437 <span class="pre">Observable o, Function fn, [Object scope]</span>)
438  : void</div><div class="description"><div class="short">Starts capture on the specified Observable. All events will be passed
439 to the supplied function with the event name + ...</div><div class="long"><p>Starts capture on the specified Observable. All events will be passed
440 to the supplied function with the event name + standard signature of the event
441 <b>before</b> the event is fired. If the supplied function returns false,
442 the event will not fire.</p>
443 <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>
444 </div></li><li><span class="pre">fn</span> : Function<div class="sub-desc"><p>The function to call when an event is fired.</p>
445 </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>
446 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
447 </li></ul></div></div></div><div id="method-clearListeners" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
448 </div><div class="long"><p>Removes all listeners for this object including the managed listeners</p>
449 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
450 </li></ul></div></div></div><div id="method-clearManagedListeners" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
451 </div><div class="long"><p>Removes all managed listeners for this object.</p>
452 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
453 </li></ul></div></div></div><div id="method-doRequest" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-doRequest" class="cls expand">doRequest</a>(
454 <span class="pre">Ext.data.Operation operation, Function callback, Object scope</span>)
455  : void</div><div class="description"><div class="short">In ServerProxy subclasses, the create, read, update and destroy methods all pass
456 through to doRequest. Each ServerPro...</div><div class="long"><p>In ServerProxy subclasses, the <a href="Ext.data.proxy.Rest.html#create" rel="Ext.data.proxy.Rest#create" class="docClass">create</a>, <a href="Ext.data.proxy.Rest.html#read" rel="Ext.data.proxy.Rest#read" class="docClass">read</a>, <a href="Ext.data.proxy.Rest.html#update" rel="Ext.data.proxy.Rest#update" class="docClass">update</a> and <a href="Ext.data.proxy.Rest.html#destroy" rel="Ext.data.proxy.Rest#destroy" class="docClass">destroy</a> methods all pass
457 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>
458 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>
459 <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>
460 </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>
461 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>The scope in which to execute the callback</p>
462 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
463 </li></ul></div></div></div><div id="method-enableBubble" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-enableBubble" class="cls expand">enableBubble</a>(
464 <span class="pre">String/Array events</span>)
465  : void</div><div class="description"><div class="short">Enables events fired by this Observable to bubble up an owner hierarchy by calling
466 this.getBubbleTarget() if present....</div><div class="long"><p>Enables events fired by this Observable to bubble up an owner hierarchy by calling
467 <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p>
468
469
470 <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
471 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
472 access the required target more quickly.</p>
473
474
475 <p>Example:</p>
476
477
478 <pre><code>Ext.override(Ext.form.field.Base, {
479 //  Add functionality to Field&#39;s initComponent to enable the change event to bubble
480 initComponent : Ext.Function.createSequence(Ext.form.field.Base.prototype.initComponent, function() {
481     this.enableBubble('change');
482 }),
483
484 //  We know that we want Field&#39;s events to bubble directly to the FormPanel.
485 getBubbleTarget : function() {
486     if (!this.formPanel) {
487         this.formPanel = this.findParentByType('form');
488     }
489     return this.formPanel;
490 }
491 });
492
493 var myForm = new Ext.formPanel({
494 title: 'User Details',
495 items: [{
496     ...
497 }],
498 listeners: {
499     change: function() {
500         // Title goes red if form has been modified.
501         myForm.header.setStyle('color', 'red');
502     }
503 }
504 });
505 </code></pre>
506
507 <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>
508 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
509 </li></ul></div></div></div><div id="method-encodeFilters" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-encodeFilters" class="cls expand">encodeFilters</a>(
510 <span class="pre">Array sorters</span>)
511  : 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,
512 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,
513 this simply JSON-encodes the filter data</p>
514 <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>
515 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">String</span>&nbsp; &nbsp;<p>The encoded filters</p>
516 </li></ul></div></div></div><div id="method-encodeSorters" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-encodeSorters" class="cls expand">encodeSorters</a>(
517 <span class="pre">Array sorters</span>)
518  : 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,
519 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,
520 this simply JSON-encodes the sorter data</p>
521 <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>
522 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">String</span>&nbsp; &nbsp;<p>The encoded sorters</p>
523 </li></ul></div></div></div><div id="method-fireEvent" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-fireEvent" class="cls expand">fireEvent</a>(
524 <span class="pre">String eventName, Object... args</span>)
525  : Boolean</div><div class="description"><div class="short">Fires the specified event with the passed parameters (minus the event name).
526
527
528 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>
529
530
531 <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>)
532 by calling <a href="Ext.data.proxy.Rest.html#enableBubble" rel="Ext.data.proxy.Rest#enableBubble" class="docClass">enableBubble</a>.</p>
533
534 <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>
535 </div></li><li><span class="pre">args</span> : Object...<div class="sub-desc"><p>Variable number of parameters are passed to handlers.</p>
536 </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>
537 </li></ul></div></div></div><div id="method-getMethod" class="member inherited"><a href="Ext.data.proxy.Rest.html#method-getMethod" rel="method-getMethod" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.data.proxy.Ajax.html" class="definedIn docClass">Ext.data.proxy.Ajax</a><br/><a href="../source/Ajax2.html#Ext-data.proxy.Ajax-method-getMethod" class="viewSource">view source</a></div><a name="getMethod"></a><a name="method-getMethod"></a><a href="Ext.data.proxy.Rest.html#" rel="method-getMethod" class="cls expand">getMethod</a>(
538 <span class="pre">Ext.data.Request request</span>)
539  : String</div><div class="description"><div class="short"><p>Returns the HTTP method name for a given request. By default this returns based on a lookup on <a href="Ext.data.proxy.Rest.html#actionMethods" rel="Ext.data.proxy.Rest#actionMethods" class="docClass">actionMethods</a>.</p>
540 </div><div class="long"><p>Returns the HTTP method name for a given request. By default this returns based on a lookup on <a href="Ext.data.proxy.Rest.html#actionMethods" rel="Ext.data.proxy.Rest#actionMethods" class="docClass">actionMethods</a>.</p>
541 <h3 class="pa">Parameters</h3><ul><li><span class="pre">request</span> : Ext.data.Request<div class="sub-desc"><p>The request object</p>
542 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">String</span>&nbsp; &nbsp;<p>The HTTP method to use (should be one of 'GET', 'POST', 'PUT' or 'DELETE')</p>
543 </li></ul></div></div></div><div id="method-getModel" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
544 </div><div class="long"><p>Returns the model attached to this Proxy</p>
545 <h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.Model</span>&nbsp; &nbsp;<p>The model</p>
546 </li></ul></div></div></div><div id="method-getReader" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
547 </div><div class="long"><p>Returns the reader currently attached to this proxy instance</p>
548 <h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.reader.Reader</span>&nbsp; &nbsp;<p>The Reader instance</p>
549 </li></ul></div></div></div><div id="method-getWriter" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.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>
550 </div><div class="long"><p>Returns the writer currently attached to this proxy instance</p>
551 <h3 class="pa">Returns</h3><ul><li><span class="pre">Ext.data.writer.Writer</span>&nbsp; &nbsp;<p>The Writer instance</p>
552 </li></ul></div></div></div><div id="method-hasListener" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-hasListener" class="cls expand">hasListener</a>(
553 <span class="pre">String eventName</span>)
554  : Boolean</div><div class="description"><div class="short"><p>Checks to see if this object has any listeners for a specified event</p>
555 </div><div class="long"><p>Checks to see if this object has any listeners for a specified event</p>
556 <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>
557 </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>
558 </li></ul></div></div></div><div id="method-observe" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-observe" class="cls expand">observe</a>(
559 <span class="pre">Function c, Object listeners</span>)
560  : void</div><div class="description"><div class="short">Sets observability on the passed class constructor.
561
562 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>
563
564 <p>This makes any event fired on any instance of the passed class also fire a single event through
565 the <strong>class</strong> allowing for central handling of events on many instances at once.</p>
566
567 <p>Usage:</p>
568
569 <pre><code>Ext.util.Observable.observe(Ext.data.Connection);
570 Ext.data.Connection.on('beforerequest', function(con, options) {
571     console.log('Ajax request made to ' + options.url);
572 });
573 </code></pre>
574 <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>
575 </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.Rest.html#addListener" rel="Ext.data.proxy.Rest#addListener" class="docClass">addListener</a>.</p>
576 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
577 </li></ul></div></div></div><div id="method-on" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-on" class="cls expand">on</a>(
578 <span class="pre">String eventName, Function handler, [Object scope], [Object options]</span>)
579  : void</div><div class="description"><div class="short"><p>Appends an event handler to this object (shorthand for <a href="Ext.data.proxy.Rest.html#addListener" rel="Ext.data.proxy.Rest#addListener" class="docClass">addListener</a>.)</p>
580 </div><div class="long"><p>Appends an event handler to this object (shorthand for <a href="Ext.data.proxy.Rest.html#addListener" rel="Ext.data.proxy.Rest#addListener" class="docClass">addListener</a>.)</p>
581 <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>
582 </div></li><li><span class="pre">handler</span> : Function<div class="sub-desc"><p>The method the event invokes</p>
583 </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.
584 <b>If omitted, defaults to the object which fired the event.</b></p>
585 </div></li><li><span class="pre">options</span> : Object<div class="sub-desc"><p>(optional) An object containing handler configuration.</p>
586 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
587 </li></ul></div></div></div><div id="method-processResponse" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-processResponse" class="cls expand">processResponse</a>(
588 <span class="pre">Object success, Object operation, Object request, Object response, Object callback, Object scope</span>)
589  : void</div><div class="description"><div class="short"><p>&nbsp;</p></div><div class="long">
590 <h3 class="pa">Parameters</h3><ul><li><span class="pre">success</span> : Object<div class="sub-desc">
591 </div></li><li><span class="pre">operation</span> : Object<div class="sub-desc">
592 </div></li><li><span class="pre">request</span> : Object<div class="sub-desc">
593 </div></li><li><span class="pre">response</span> : Object<div class="sub-desc">
594 </div></li><li><span class="pre">callback</span> : Object<div class="sub-desc">
595 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc">
596 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
597 </li></ul></div></div></div><div id="method-relayEvents" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-relayEvents" class="cls expand">relayEvents</a>(
598 <span class="pre">Object origin, Array events, Object prefix</span>)
599  : 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>
600 </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>
601 <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>
602 </div></li><li><span class="pre">events</span> : Array<div class="sub-desc"><p>Array of event names to relay.</p>
603 </div></li><li><span class="pre">prefix</span> : Object<div class="sub-desc">
604 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
605 </li></ul></div></div></div><div id="method-releaseCapture" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-releaseCapture" class="cls expand">releaseCapture</a>(
606 <span class="pre">Observable o</span>)
607  : void</div><div class="description"><div class="short"><p>Removes <b>all</b> added captures from the Observable.</p>
608 </div><div class="long"><p>Removes <b>all</b> added captures from the Observable.</p>
609 <h3 class="pa">Parameters</h3><ul><li><span class="pre">o</span> : Observable<div class="sub-desc"><p>The Observable to release</p>
610 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
611 </li></ul></div></div></div><div id="method-removeListener" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-removeListener" class="cls expand">removeListener</a>(
612 <span class="pre">String eventName, Function handler, [Object scope]</span>)
613  : void</div><div class="description"><div class="short"><p>Removes an event handler.</p>
614 </div><div class="long"><p>Removes an event handler.</p>
615 <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>
616 </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.Rest.html#addListener" rel="Ext.data.proxy.Rest#addListener" class="docClass">addListener</a> call.</b></p>
617 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>(optional) The scope originally specified for the handler.</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-removeManagedListener" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-removeManagedListener" class="cls expand">removeManagedListener</a>(
620 <span class="pre">Observable|Element item, Object|String ename, Function fn, Object scope</span>)
621  : void</div><div class="description"><div class="short"><p>Removes listeners that were added by the <a href="Ext.data.proxy.Rest.html#mon" rel="Ext.data.proxy.Rest#mon" class="docClass">mon</a> method.</p>
622 </div><div class="long"><p>Removes listeners that were added by the <a href="Ext.data.proxy.Rest.html#mon" rel="Ext.data.proxy.Rest#mon" class="docClass">mon</a> method.</p>
623 <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>
624 </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>
625 </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
626 is the handler function.</p>
627 </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
628 is the scope (<code>this</code> reference) in which the handler function is executed.</p>
629 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
630 </li></ul></div></div></div><div id="method-resumeEvents" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-resumeEvents" class="cls expand">resumeEvents</a> : void</div><div class="description"><div class="short">Resume firing events. (see suspendEvents)
631 If events were suspended using the queueSuspended parameter, then all
632 event...</div><div class="long"><p>Resume firing events. (see <a href="Ext.data.proxy.Rest.html#suspendEvents" rel="Ext.data.proxy.Rest#suspendEvents" class="docClass">suspendEvents</a>)
633 If events were suspended using the <code><b>queueSuspended</b></code> parameter, then all
634 events fired during event suspension will be sent to any listeners now.</p>
635 <h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
636 </li></ul></div></div></div><div id="method-setModel" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-setModel" class="cls expand">setModel</a>(
637 <span class="pre">String|Ext.data.Model model, Boolean setOnStore</span>)
638  : 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>
639 </div><div class="long"><p>Sets the model associated with this proxy. This will only usually be called by a Store</p>
640 <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,
641 or a reference to the model's constructor</p>
642 </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>
643 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
644 </li></ul></div></div></div><div id="method-setReader" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-setReader" class="cls expand">setReader</a>(
645 <span class="pre">String|Object|Ext.data.reader.Reader reader</span>)
646  : 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>
647 </div><div class="long"><p>Sets the Proxy's Reader by string, config object or Reader instance</p>
648 <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
649 or an <a href="Ext.data.reader.Reader.html" rel="Ext.data.reader.Reader" class="docClass">Ext.data.reader.Reader</a> instance</p>
650 </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>
651 </li></ul></div></div></div><div id="method-setWriter" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-setWriter" class="cls expand">setWriter</a>(
652 <span class="pre">String|Object|Ext.data.writer.Writer writer</span>)
653  : 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>
654 </div><div class="long"><p>Sets the Proxy's Writer by string, config object or Writer instance</p>
655 <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
656 or an <a href="Ext.data.writer.Writer.html" rel="Ext.data.writer.Writer" class="docClass">Ext.data.writer.Writer</a> instance</p>
657 </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>
658 </li></ul></div></div></div><div id="method-suspendEvents" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-suspendEvents" class="cls expand">suspendEvents</a>(
659 <span class="pre">Boolean queueSuspended</span>)
660  : void</div><div class="description"><div class="short"><p>Suspend the firing of all events. (see <a href="Ext.data.proxy.Rest.html#resumeEvents" rel="Ext.data.proxy.Rest#resumeEvents" class="docClass">resumeEvents</a>)</p>
661 </div><div class="long"><p>Suspend the firing of all events. (see <a href="Ext.data.proxy.Rest.html#resumeEvents" rel="Ext.data.proxy.Rest#resumeEvents" class="docClass">resumeEvents</a>)</p>
662 <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
663 after the <a href="Ext.data.proxy.Rest.html#resumeEvents" rel="Ext.data.proxy.Rest#resumeEvents" class="docClass">resumeEvents</a> call instead of discarding all suspended events;</p>
664 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
665 </li></ul></div></div></div><div id="method-un" class="member inherited"><a href="Ext.data.proxy.Rest.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.Rest.html#" rel="method-un" class="cls expand">un</a>(
666 <span class="pre">String eventName, Function handler, [Object scope]</span>)
667  : void</div><div class="description"><div class="short"><p>Removes an event handler (shorthand for <a href="Ext.data.proxy.Rest.html#removeListener" rel="Ext.data.proxy.Rest#removeListener" class="docClass">removeListener</a>.)</p>
668 </div><div class="long"><p>Removes an event handler (shorthand for <a href="Ext.data.proxy.Rest.html#removeListener" rel="Ext.data.proxy.Rest#removeListener" class="docClass">removeListener</a>.)</p>
669 <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>
670 </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.Rest.html#addListener" rel="Ext.data.proxy.Rest#addListener" class="docClass">addListener</a> call.</b></p>
671 </div></li><li><span class="pre">scope</span> : Object<div class="sub-desc"><p>(optional) The scope originally specified for the handler.</p>
672 </div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
673 </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 inherited"><a href="Ext.data.proxy.Rest.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.Server.html" class="definedIn docClass">Ext.data.proxy.Server</a><br/><a href="../source/Server.html#Ext-data.proxy.Server-event-exception" class="viewSource">view source</a></div><a name="exception"></a><a name="event-exception"></a><a href="Ext.data.proxy.Rest.html#" rel="event-exception" class="cls expand">exception</a>(
674 <span class="pre">Ext.data.proxy.Proxy this, Object response, Ext.data.Operation operation</span>)
675 </div><div class="description"><div class="short"><p>Fires when the server returns an exception</p>
676 </div><div class="long"><p>Fires when the server returns an exception</p>
677 <h3 class="pa">Parameters</h3><ul><li><span class="pre">this</span> : Ext.data.proxy.Proxy<div class="sub-desc">
678 </div></li><li><span class="pre">response</span> : Object<div class="sub-desc"><p>The response from the AJAX request</p>
679 </div></li><li><span class="pre">operation</span> : Ext.data.Operation<div class="sub-desc"><p>The operation that triggered request</p>
680 </div></li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>