/javascripts/lib/docs/output/Ext.data.Store.html

https://bitbucket.org/ksokmesa/sina-asian · HTML · 701 lines · 692 code · 9 blank · 0 comment · 0 complexity · 40f42bbf724195d7953d24a6f9af7bf4 MD5 · raw file

Large files are truncated click here to view the full file

  1. <div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.data.Store-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>&#13;<a class="inner-link" href="#Ext.data.Store-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>&#13;<a class="inner-link" href="#Ext.data.Store-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>&#13;<a class="inner-link" href="#Ext.data.Store-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>&#13;<a class="bookmark" href="../docs/?class=Ext.data.Store"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>&#13;</div><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.Observable.html" ext:member="" ext:cls="Ext.util.Observable">Observable</a>&#13;&nbsp;&nbsp;<img src="resources/elbow-end.gif">Store</pre></div><h1>Class <a href="source/Store.html#cls-Ext.data.Store">Ext.data.Store</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr><tr><td class="label">Defined In:</td><td class="hd-info"><a href="source/Store.html#cls-Ext.data.Store">Store.js</a></td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Store.html#cls-Ext.data.Store">Store</a></td></tr><tr><td class="label">Subclasses:</td><td class="hd-info"><a href="output/Ext.data.ArrayStore.html" ext:cls="Ext.data.ArrayStore">ArrayStore</a>,&#13;<a href="output/Ext.data.DirectStore.html" ext:cls="Ext.data.DirectStore">DirectStore</a>,&#13;<a href="output/Ext.data.GroupingStore.html" ext:cls="Ext.data.GroupingStore">GroupingStore</a>,&#13;<a href="output/Ext.data.JsonStore.html" ext:cls="Ext.data.JsonStore">JsonStore</a>,&#13;<a href="output/Ext.data.XmlStore.html" ext:cls="Ext.data.XmlStore">XmlStore</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.util.Observable.html" ext:cls="Ext.util.Observable" ext:member="">Observable</a></td></tr></table><div class="description"><p>The Store class encapsulates a client side cache of <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Record</a>
  2. objects which provide input data for Components such as the <a href="output/Ext.grid.GridPanel.html" ext:cls="Ext.grid.GridPanel">GridPanel</a>,
  3. the <a href="output/Ext.form.ComboBox.html" ext:cls="Ext.form.ComboBox">ComboBox</a>, or the <a href="output/Ext.DataView.html" ext:cls="Ext.DataView">DataView</a>.</p>
  4. <p><u>Retrieving Data</u></p>
  5. <p>A Store object may access a data object using:<div class="mdetail-params"><ul>
  6. <li><a href="output/Ext.data.Store.html#Ext.data.Store-proxy" ext:member="proxy" ext:cls="Ext.data.Store">configured implementation</a> of <a href="output/Ext.data.DataProxy.html" ext:cls="Ext.data.DataProxy">DataProxy</a></li>
  7. <li><a href="output/Ext.data.Store.html#Ext.data.Store-data" ext:member="data" ext:cls="Ext.data.Store">data</a> to automatically pass in data</li>
  8. <li><a href="output/Ext.data.Store.html#Ext.data.Store-loadData" ext:member="loadData" ext:cls="Ext.data.Store">loadData</a> to manually pass in data</li>
  9. </ul></div></p>
  10. <p><u>Reading Data</u></p>
  11. <p>A Store object has no inherent knowledge of the format of the data object (it could be
  12. an Array, XML, or JSON). A Store object uses an appropriate <a href="output/Ext.data.Store.html#Ext.data.Store-reader" ext:member="reader" ext:cls="Ext.data.Store">configured implementation</a>
  13. of a <a href="output/Ext.data.DataReader.html" ext:cls="Ext.data.DataReader">DataReader</a> to create <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Record</a> instances from the data
  14. object.</p>
  15. <p><u>Store Types</u></p>
  16. <p>There are several implementations of Store available which are customized for use with
  17. a specific DataReader implementation. Here is an example using an ArrayStore which implicitly
  18. creates a reader commensurate to an Array data object.</p>
  19. <pre><code><b>var</b> myStore = <b>new</b> Ext.data.ArrayStore({
  20. fields: [<em>'fullname'</em>, <em>'first'</em>],
  21. idIndex: 0 <i>// id <b>for</b> each record will be the first element</i>
  22. });</code></pre>
  23. <p>For custom implementations create a basic <a href="output/Ext.data.Store.html" ext:cls="Ext.data.Store">Ext.data.Store</a> configured as needed:</p>
  24. <pre><code><i>// create a <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Record</a> constructor:</i>
  25. <b>var</b> rt = Ext.data.Record.create([
  26. {name: <em>'fullname'</em>},
  27. {name: <em>'first'</em>}
  28. ]);
  29. <b>var</b> myStore = <b>new</b> Ext.data.Store({
  30. <i>// explicitly create reader</i>
  31. reader: <b>new</b> Ext.data.ArrayReader(
  32. {
  33. idIndex: 0 <i>// id <b>for</b> each record will be the first element</i>
  34. },
  35. rt <i>// recordType</i>
  36. )
  37. });</code></pre>
  38. <p>Load some data into store (note the data object is an array which corresponds to the reader):</p>
  39. <pre><code><b>var</b> myData = [
  40. [1, <em>'Fred Flintstone'</em>, <em>'Fred'</em>], <i>// note that id <b>for</b> the record is the first element</i>
  41. [2, <em>'Barney Rubble'</em>, <em>'Barney'</em>]
  42. ];
  43. myStore.loadData(myData);</code></pre>
  44. <p>Records are cached and made available through accessor functions. An example of adding
  45. a record to the store:</p>
  46. <pre><code><b>var</b> defaultData = {
  47. fullname: <em>'Full Name'</em>,
  48. first: <em>'First Name'</em>
  49. };
  50. <b>var</b> recId = 100; <i>// provide unique id <b>for</b> the record</i>
  51. <b>var</b> r = <b>new</b> myStore.recordType(defaultData, ++recId); <i>// create <b>new</b> record</i>
  52. myStore.<a href="output/Ext.data.Store.html#Ext.data.Store-insert" ext:member="insert" ext:cls="Ext.data.Store">insert</a>(0, r); <i>// insert a <b>new</b> record into the store (also see <a href="output/Ext.data.Store.html#Ext.data.Store-add" ext:member="add" ext:cls="Ext.data.Store">add</a>)</i></code></pre>
  53. <p><u>Writing Data</u></p>
  54. <p>And <b>new in Ext version 3</b>, use the new <a href="output/Ext.data.DataWriter.html" ext:cls="Ext.data.DataWriter">DataWriter</a> to create an automated, <a href="http://extjs.com/deploy/dev/examples/writer/writer.html">Writable Store</a>
  55. along with <a href="http://extjs.com/deploy/dev/examples/restful/restful.html">RESTful features.</a></div><div class="hr"></div><a id="Ext.data.Store-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-autoDestroy"></a><b><a href="source/Store.html#cfg-Ext.data.Store-autoDestroy">autoDestroy</a></b> : Boolean<div class="mdesc"><div class="short">true to destroy the store when the component the store is bound
  56. to is destroyed (defaults to false).
  57. Note: this shoul...</div><div class="long"><tt>true</tt> to destroy the store when the component the store is bound
  58. to is destroyed (defaults to <tt>false</tt>).
  59. <p><b>Note</b>: this should be set to true when using stores that are bound to only 1 component.</p></div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-autoLoad"></a><b><a href="source/Store.html#cfg-Ext.data.Store-autoLoad">autoLoad</a></b> : Boolean/Object<div class="mdesc"><div class="short">If data is not specified, and if autoLoad
  60. is true or an Object, this store's load method is automatically called
  61. afte...</div><div class="long">If <tt><a href="output/Ext.data.Store.html#Ext.data.Store-data" ext:member="data" ext:cls="Ext.data.Store">data</a></tt> is not specified, and if <tt>autoLoad</tt>
  62. is <tt>true</tt> or an <tt>Object</tt>, this store's <a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">load</a> method is automatically called
  63. after creation. If the value of <tt>autoLoad</tt> is an <tt>Object</tt>, this <tt>Object</tt> will
  64. be passed to the store's <a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">load</a> method.</div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-autoSave"></a><b><a href="source/Store.html#cfg-Ext.data.Store-autoSave">autoSave</a></b> : Boolean<div class="mdesc"><div class="short">Defaults to true causing the store to automatically save records to
  65. the server when a record is modified (ie: becomes...</div><div class="long"><p>Defaults to <tt>true</tt> causing the store to automatically <a href="output/Ext.data.Store.html#Ext.data.Store-save" ext:member="save" ext:cls="Ext.data.Store">save</a> records to
  66. the server when a record is modified (ie: becomes 'dirty'). Specify <tt>false</tt> to manually call <a href="output/Ext.data.Store.html#Ext.data.Store-save" ext:member="save" ext:cls="Ext.data.Store">save</a>
  67. to send all modifiedRecords to the server.</p>
  68. <br><p><b>Note</b>: each CRUD action will be sent as a separate request.</p></div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-baseParams"></a><b><a href="source/Store.html#cfg-Ext.data.Store-baseParams">baseParams</a></b> : Object<div class="mdesc"><div class="short">An object containing properties which are to be sent as parameters
  69. for every HTTP request.
  70. Parameters are encoded as ...</div><div class="long"><p>An object containing properties which are to be sent as parameters
  71. for <i>every</i> HTTP request.</p>
  72. <p>Parameters are encoded as standard HTTP parameters using <a href="output/Ext.html#Ext-urlEncode" ext:member="urlEncode" ext:cls="Ext">Ext.urlEncode</a>.</p>
  73. <p><b>Note</b>: <code>baseParams</code> may be superseded by any <code>params</code>
  74. specified in a <code><a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">load</a></code> request, see <code><a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">load</a></code>
  75. for more details.</p>
  76. This property may be modified after creation using the <code><a href="output/Ext.data.Store.html#Ext.data.Store-setBaseParam" ext:member="setBaseParam" ext:cls="Ext.data.Store">setBaseParam</a></code>
  77. method.</div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-batch"></a><b><a href="source/Store.html#cfg-Ext.data.Store-batch">batch</a></b> : Boolean<div class="mdesc"><div class="short">Defaults to true (unless restful:true). Multiple
  78. requests for each CRUD action (CREATE, READ, UPDATE and DESTROY) wil...</div><div class="long"><p>Defaults to <tt>true</tt> (unless <code><a href="output/Ext.data.Store.html#Ext.data.Store-restful" ext:member="restful" ext:cls="Ext.data.Store">restful</a>:true</code>). Multiple
  79. requests for each CRUD action (CREATE, READ, UPDATE and DESTROY) will be combined
  80. and sent as one transaction. Only applies when <code><a href="output/Ext.data.Store.html#Ext.data.Store-autoSave" ext:member="autoSave" ext:cls="Ext.data.Store">autoSave</a></code> is set
  81. to <tt>false</tt>.</p>
  82. <br><p>If Store is RESTful, the DataProxy is also RESTful, and a unique transaction is
  83. generated for each record.</p></div></div></td><td class="msource">Store</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-data"></a><b><a href="source/Store.html#cfg-Ext.data.Store-data">data</a></b> : Array<div class="mdesc">An inline data object readable by the <code><a href="output/Ext.data.Store.html#Ext.data.Store-reader" ext:member="reader" ext:cls="Ext.data.Store">reader</a></code>.
  84. Typically this option, or the <code><a href="output/Ext.data.Store.html#Ext.data.Store-url" ext:member="url" ext:cls="Ext.data.Store">url</a></code> option will be specified.</div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-defaultParamNames"></a><b><a href="source/Store.html#cfg-Ext.data.Store-defaultParamNames">defaultParamNames</a></b> : Object<div class="mdesc"><div class="short">Provides the default values for the paramNames property. To globally modify the parameters
  85. for all stores, this objec...</div><div class="long">Provides the default values for the <a href="output/Ext.data.Store.html#Ext.data.Store-paramNames" ext:member="paramNames" ext:cls="Ext.data.Store">paramNames</a> property. To globally modify the parameters
  86. for all stores, this object should be changed on the store prototype.</div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-listeners"></a><b><a href="source/Observable.html#cfg-Ext.util.Observable-listeners">listeners</a></b> : Object<div class="mdesc"><div class="short">A config object containing one or more event handlers to be added to this
  87. object during initialization. This should ...</div><div class="long"><p>A config object containing one or more event handlers to be added to this
  88. object during initialization. This should be a valid listeners config object as specified in the
  89. <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> example for attaching multiple handlers at once.</p>
  90. <br><p><b><u>DOM events from ExtJs <a href="output/Ext.Component.html" ext:cls="Ext.Component">Components</a></u></b></p>
  91. <br><p>While <i>some</i> ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
  92. is usually only done when extra value can be added. For example the <a href="output/Ext.DataView.html" ext:cls="Ext.DataView">DataView</a>'s
  93. <b><code><a href="output/Ext.DataView.html#Ext.DataView-click" ext:member="click" ext:cls="Ext.DataView">click</a></code></b> event passing the node clicked on. To access DOM
  94. events directly from a Component's HTMLElement, listeners must be added to the <i><a href="output/Ext.Component.html#Ext.Component-getEl" ext:member="getEl" ext:cls="Ext.Component">Element</a></i> after the Component
  95. has been rendered. A plugin can simplify this step:<pre><code><i>// Plugin is configured <b>with</b> a listeners config object.</i>
  96. <i>// The Component is appended to the argument list of all handler functions.</i>
  97. Ext.DomObserver = Ext.extend(Object, {
  98. constructor: <b>function</b>(config) {
  99. this.listeners = config.listeners ? config.listeners : config;
  100. },
  101. <i>// Component passes itself into plugin&#39;s init method</i>
  102. init: <b>function</b>(c) {
  103. <b>var</b> p, l = this.listeners;
  104. <b>for</b> (p <b>in</b> l) {
  105. <b>if</b> (Ext.isFunction(l[p])) {
  106. l[p] = this.createHandler(l[p], c);
  107. } <b>else</b> {
  108. l[p].fn = this.createHandler(l[p].fn, c);
  109. }
  110. }
  111. <i>// Add the listeners to the Element immediately following the render call</i>
  112. c.render = c.render.<a href="output/Function.html#Function-createSequence" ext:member="createSequence" ext:cls="Function">createSequence</a>(<b>function</b>() {
  113. <b>var</b> e = c.getEl();
  114. <b>if</b> (e) {
  115. e.on(l);
  116. }
  117. });
  118. },
  119. createHandler: <b>function</b>(fn, c) {
  120. <b>return</b> <b>function</b>(e) {
  121. fn.call(this, e, c);
  122. };
  123. }
  124. });
  125. <b>var</b> combo = <b>new</b> Ext.form.ComboBox({
  126. <i>// Collapse combo when its element is clicked on</i>
  127. plugins: [ <b>new</b> Ext.DomObserver({
  128. click: <b>function</b>(evt, comp) {
  129. comp.collapse();
  130. }
  131. })],
  132. store: myStore,
  133. typeAhead: true,
  134. mode: <em>'local'</em>,
  135. triggerAction: <em>'all'</em>
  136. });</code></pre></p></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#listeners" ext:member="#listeners" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-paramNames"></a><b><a href="source/Store.html#cfg-Ext.data.Store-paramNames">paramNames</a></b> : Object<div class="mdesc"><div class="short">An object containing properties which specify the names of the paging and
  137. sorting parameters passed to remote servers...</div><div class="long"><p>An object containing properties which specify the names of the paging and
  138. sorting parameters passed to remote servers when loading blocks of data. By default, this
  139. object takes the following form:</p><pre><code>{
  140. start : <em>'start'</em>, <i>// The parameter name which specifies the start row</i>
  141. limit : <em>'limit'</em>, <i>// The parameter name which specifies number of rows to <b>return</b></i>
  142. sort : <em>'sort'</em>, <i>// The parameter name which specifies the column to sort on</i>
  143. dir : <em>'dir'</em> <i>// The parameter name which specifies the sort direction</i>
  144. }</code></pre>
  145. <p>The server must produce the requested data block upon receipt of these parameter names.
  146. If different parameter names are required, this property can be overriden using a configuration
  147. property.</p>
  148. <p>A <a href="output/Ext.PagingToolbar.html" ext:cls="Ext.PagingToolbar">PagingToolbar</a> bound to this Store uses this property to determine
  149. the parameter names to use in its <a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">requests</a>.</div></div></td><td class="msource">Store</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-proxy"></a><b><a href="source/Store.html#cfg-Ext.data.Store-proxy">proxy</a></b> : Ext.data.DataProxy<div class="mdesc">The <a href="output/Ext.data.DataProxy.html" ext:cls="Ext.data.DataProxy">DataProxy</a> object which provides
  150. access to a data object. See <code><a href="output/Ext.data.Store.html#Ext.data.Store-url" ext:member="url" ext:cls="Ext.data.Store">url</a></code>.</div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-pruneModifiedRecords"></a><b><a href="source/Store.html#cfg-Ext.data.Store-pruneModifiedRecords">pruneModifiedRecords</a></b> : Boolean<div class="mdesc"><div class="short">true to clear all modified record information each time
  151. the store is loaded or when a record is removed (defaults to ...</div><div class="long"><tt>true</tt> to clear all modified record information each time
  152. the store is loaded or when a record is removed (defaults to <tt>false</tt>). See <a href="output/Ext.data.Store.html#Ext.data.Store-getModifiedRecords" ext:member="getModifiedRecords" ext:cls="Ext.data.Store">getModifiedRecords</a>
  153. for the accessor method to retrieve the modified records.</div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-reader"></a><b><a href="source/Store.html#cfg-Ext.data.Store-reader">reader</a></b> : Ext.data.DataReader<div class="mdesc"><div class="short">The Reader object which processes the
  154. data object and returns an Array of Ext.data.Record objects which are cached ke...</div><div class="long">The <a href="output/Ext.data.DataReader.html" ext:cls="Ext.data.DataReader">Reader</a> object which processes the
  155. data object and returns an Array of <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Ext.data.Record</a> objects which are cached keyed by their
  156. <b><tt><a href="output/Ext.data.Record.html#Ext.data.Record-id" ext:member="id" ext:cls="Ext.data.Record">id</a></tt></b> property.</div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-remoteSort"></a><b><a href="source/Store.html#cfg-Ext.data.Store-remoteSort">remoteSort</a></b> : boolean<div class="mdesc"><div class="short">true if sorting is to be handled by requesting the Proxy
  157. to provide a refreshed version of the data object in sorted ...</div><div class="long"><tt>true</tt> if sorting is to be handled by requesting the <tt><a href="output/Ext.data.Store.html#Ext.data.Store-proxy" ext:member="proxy" ext:cls="Ext.data.Store">Proxy</a></tt>
  158. to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache
  159. in place (defaults to <tt>false</tt>).
  160. <p>If <tt>remoteSort</tt> is <tt>true</tt>, then clicking on a <a href="output/Ext.grid.Column.html" ext:cls="Ext.grid.Column">Grid Column</a>'s
  161. <a href="output/Ext.grid.Column.html#Ext.grid.Column-header" ext:member="header" ext:cls="Ext.grid.Column">header</a> causes the current page to be requested from the server appending
  162. the following two parameters to the <b><tt><a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">params</a></tt></b>:<div class="mdetail-params"><ul>
  163. <li><b><tt>sort</tt></b> : String<p class="sub-desc">The <tt>name</tt> (as specified in the Record's
  164. <a href="output/Ext.data.Field.html" ext:cls="Ext.data.Field">Field definition</a>) of the field to sort on.</p></li>
  165. <li><b><tt>dir</tt></b> : String<p class="sub-desc">The direction of the sort, 'ASC' or 'DESC' (case-sensitive).</p></li>
  166. </ul></div></p></div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-restful"></a><b><a href="source/Store.html#cfg-Ext.data.Store-restful">restful</a></b> : Boolean<div class="mdesc"><div class="short">Defaults to false. Set to true to have the Store and the set
  167. Proxy operate in a RESTful manner. The store will autom...</div><div class="long">Defaults to <tt>false</tt>. Set to <tt>true</tt> to have the Store and the set
  168. Proxy operate in a RESTful manner. The store will automatically generate GET, POST,
  169. PUT and DELETE requests to the server. The HTTP method used for any given CRUD
  170. action is described in <a href="output/Ext.data.Api.html#Ext.data.Api-restActions" ext:member="restActions" ext:cls="Ext.data.Api">Ext.data.Api.restActions</a>. For additional information
  171. see <a href="output/Ext.data.DataProxy.html#Ext.data.DataProxy-restful" ext:member="restful" ext:cls="Ext.data.DataProxy">Ext.data.DataProxy.restful</a>.
  172. <p><b>Note</b>: if <code><a href="output/Ext.data.Store.html#Ext.data.Store-restful" ext:member="restful" ext:cls="Ext.data.Store">restful</a>:true</code> <code>batch</code> will
  173. internally be set to <tt>false</tt>.</p></div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-sortInfo"></a><b><a href="source/Store.html#cfg-Ext.data.Store-sortInfo">sortInfo</a></b> : Object<div class="mdesc"><div class="short">A config object to specify the sort order in the request of a Store's
  174. load operation. Note that for local sorting, t...</div><div class="long">A config object to specify the sort order in the request of a Store's
  175. <a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">load</a> operation. Note that for local sorting, the <tt>direction</tt> property is
  176. case-sensitive. See also <a href="output/Ext.data.Store.html#Ext.data.Store-remoteSort" ext:member="remoteSort" ext:cls="Ext.data.Store">remoteSort</a> and <a href="output/Ext.data.Store.html#Ext.data.Store-paramNames" ext:member="paramNames" ext:cls="Ext.data.Store">paramNames</a>.
  177. For example:<pre><code>sortInfo: {
  178. field: <em>'fieldName'</em>,
  179. direction: <em>'ASC'</em> <i>// or <em>'DESC'</em> (<b>case</b> sensitive <b>for</b> local sorting)</i>
  180. }</code></pre></div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-storeId"></a><b><a href="source/Store.html#cfg-Ext.data.Store-storeId">storeId</a></b> : String<div class="mdesc"><div class="short">If passed, the id to use to register with the StoreMgr.
  181. Note: if a (deprecated) id is specified it will supersede the...</div><div class="long">If passed, the id to use to register with the <b><a href="output/Ext.StoreMgr.html" ext:cls="Ext.StoreMgr">StoreMgr</a></b>.
  182. <p><b>Note</b>: if a (deprecated) <tt><a href="output/Ext.data.Store.html#Ext.data.Store-id" ext:member="id" ext:cls="Ext.data.Store">id</a></tt> is specified it will supersede the <tt>storeId</tt>
  183. assignment.</p></div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-url"></a><b><a href="source/Store.html#cfg-Ext.data.Store-url">url</a></b> : String<div class="mdesc"><div class="short">If a proxy is not specified the url will be used to
  184. implicitly configure a HttpProxy if an url is specified.
  185. Typicall...</div><div class="long">If a <tt><a href="output/Ext.data.Store.html#Ext.data.Store-proxy" ext:member="proxy" ext:cls="Ext.data.Store">proxy</a></tt> is not specified the <tt>url</tt> will be used to
  186. implicitly configure a <a href="output/Ext.data.HttpProxy.html" ext:cls="Ext.data.HttpProxy">HttpProxy</a> if an <tt>url</tt> is specified.
  187. Typically this option, or the <code><a href="output/Ext.data.Store.html#Ext.data.Store-data" ext:member="data" ext:cls="Ext.data.Store">data</a></code> option will be specified.</div></div></td><td class="msource">Store</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-writer"></a><b><a href="source/Store.html#cfg-Ext.data.Store-writer">writer</a></b> : Ext.data.DataWriter<div class="mdesc"><div class="short">The Writer object which processes a record object for being written
  188. to the server-side database.
  189. When a writer is ins...</div><div class="long"><p>The <a href="output/Ext.data.DataWriter.html" ext:cls="Ext.data.DataWriter">Writer</a> object which processes a record object for being written
  190. to the server-side database.</p>
  191. <br><p>When a writer is installed into a Store the <a href="output/Ext.data.Store.html#Ext.data.Store-add" ext:member="add" ext:cls="Ext.data.Store">add</a>, <a href="output/Ext.data.Store.html#Ext.data.Store-remove" ext:member="remove" ext:cls="Ext.data.Store">remove</a>, and <a href="output/Ext.data.Store.html#Ext.data.Store-update" ext:member="update" ext:cls="Ext.data.Store">update</a>
  192. events on the store are monitored in order to remotely <a href="output/Ext.data.Store.html#Ext.data.Store-createRecords" ext:member="createRecords" ext:cls="Ext.data.Store">create records</a>,
  193. <a href="output/Ext.data.Store.html#Ext.data.Store-destroyRecord" ext:member="destroyRecord" ext:cls="Ext.data.Store">destroy records</a>, or <a href="output/Ext.data.Store.html#Ext.data.Store-updateRecord" ext:member="updateRecord" ext:cls="Ext.data.Store">update records</a>.</p>
  194. <br><p>The proxy for this store will relay any <a href="output/Ext.data.Store.html#Ext.data.Store-writexception" ext:member="writexception" ext:cls="Ext.data.Store">writexception</a> events to this store.</p>
  195. <br><p>Sample implementation:
  196. <pre><code><b>var</b> writer = <b>new</b> <a href="output/Ext.data.JsonWriter.html" ext:cls="Ext.data.JsonWriter">Ext.data.JsonWriter</a>({
  197. encode: true,
  198. writeAllFields: true <i>// write all fields, not just those that changed</i>
  199. });
  200. <i>// Typical Store collecting the Proxy, Reader and Writer together.</i>
  201. <b>var</b> store = <b>new</b> Ext.data.Store({
  202. storeId: <em>'user'</em>,
  203. root: <em>'records'</em>,
  204. proxy: proxy,
  205. reader: reader,
  206. writer: writer, <i>// <-- plug a DataWriter into the store just as you would a Reader</i>
  207. paramsAsHash: true,
  208. autoSave: false <i>// <-- false to delay executing create, update, destroy requests</i>
  209. <i>// until specifically told to <b>do</b> so.</i>
  210. });</code></pre></p></div></div></td><td class="msource">Store</td></tr></tbody></table><a id="Ext.data.Store-props"></a><h2>Public Properties</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Property</th><th class="msource-header">Defined By</th></tr><tr class="property-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-baseParams"></a><b><a href="source/Store.html#prop-Ext.data.Store-baseParams">baseParams</a></b> : Object<div class="mdesc"><div class="short">See the corresponding configuration option
  211. for a description of this property.
  212. To modify this property see setBasePar...</div><div class="long">See the <code><a href="output/Ext.data.Store.html#Ext.data.Store-baseParams" ext:member="baseParams" ext:cls="Ext.data.Store">corresponding configuration option</a></code>
  213. for a description of this property.
  214. To modify this property see <code><a href="output/Ext.data.Store.html#Ext.data.Store-setBaseParam" ext:member="setBaseParam" ext:cls="Ext.data.Store">setBaseParam</a></code>.</div></div></td><td class="msource">Store</td></tr><tr class="property-row "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-fields"></a><b><a href="source/Store.html#prop-Ext.data.Store-fields">fields</a></b> : Ext.util.MixedCollection<div class="mdesc">A <a href="output/Ext.util.MixedCollection.html" ext:cls="Ext.util.MixedCollection">MixedCollection</a> containing the defined <a href="output/Ext.data.Field.html" ext:cls="Ext.data.Field">Field</a>s
  215. for the <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Records</a> stored in this Store. Read-only.</div></td><td class="msource">Store</td></tr><tr class="property-row "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-hasMultiSort"></a><b><a href="source/Store.html#prop-Ext.data.Store-hasMultiSort">hasMultiSort</a></b> : Boolean
  216. True if this store is currently sorted by more than one field/direction combination.<div class="mdesc"></div></td><td class="msource">Store</td></tr><tr class="property-row "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-isDestroyed"></a><b><a href="source/Store.html#prop-Ext.data.Store-isDestroyed">isDestroyed</a></b> : Boolean
  217. True if the store has been destroyed already. Read only<div class="mdesc"></div></td><td class="msource">Store</td></tr><tr class="property-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-lastOptions"></a><b><a href="source/Store.html#prop-Ext.data.Store-lastOptions">lastOptions</a></b> : Object<div class="mdesc"><div class="short">Contains the last options object used as the parameter to the load method. See load
  218. for the details of what this may ...</div><div class="long">Contains the last options object used as the parameter to the <a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">load</a> method. See <a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">load</a>
  219. for the details of what this may contain. This may be useful for accessing any params which were used
  220. to load the current Record cache.</div></div></td><td class="msource">Store</td></tr><tr class="property-row "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-multiSortInfo"></a><b><a href="source/Store.html#prop-Ext.data.Store-multiSortInfo">multiSortInfo</a></b> : Object
  221. Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields<div class="mdesc"></div></td><td class="msource">Store</td></tr><tr class="property-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-recordType"></a><b><a href="source/Store.html#prop-Ext.data.Store-recordType">recordType</a></b> : Function<div class="mdesc"><div class="short">The Record constructor as supplied to (or created by) the
  222. Reader. Read-only.
  223. If the Reader was constructed by passing...</div><div class="long">The <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Record</a> constructor as supplied to (or created by) the
  224. <a href="output/Ext.data.DataReader.html" ext:cls="Ext.data.DataReader">Reader</a>. Read-only.
  225. <p>If the Reader was constructed by passing in an Array of <a href="output/Ext.data.Field.html" ext:cls="Ext.data.Field">Ext.data.Field</a> definition objects,
  226. instead of a Record constructor, it will implicitly create a Record constructor from that Array (see
  227. <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Ext.data.Record</a>.<a href="output/Ext.data.Record.html#Ext.data.Record-create" ext:member="create" ext:cls="Ext.data.Record">create</a> for additional details).</p>
  228. <p>This property may be used to create new Records of the type held in this Store, for example:</p><pre><code><i>// create the data store</i>
  229. <b>var</b> store = <b>new</b> Ext.data.ArrayStore({
  230. autoDestroy: true,
  231. fields: [
  232. {name: <em>'company'</em>},
  233. {name: <em>'price'</em>, type: <em>'float'</em>},
  234. {name: <em>'change'</em>, type: <em>'float'</em>},
  235. {name: <em>'pctChange'</em>, type: <em>'float'</em>},
  236. {name: <em>'lastChange'</em>, type: <em>'date'</em>, dateFormat: <em>'n/j h:ia'</em>}
  237. ]
  238. });
  239. store.loadData(myData);
  240. <i>// create the Grid</i>
  241. <b>var</b> grid = <b>new</b> Ext.grid.EditorGridPanel({
  242. store: store,
  243. colModel: <b>new</b> Ext.grid.ColumnModel({
  244. columns: [
  245. {id:<em>'company'</em>, header: <em>'Company'</em>, width: 160, dataIndex: <em>'company'</em>},
  246. {header: <em>'Price'</em>, renderer: <em>'usMoney'</em>, dataIndex: <em>'price'</em>},
  247. {header: <em>'Change'</em>, renderer: change, dataIndex: <em>'change'</em>},
  248. {header: <em>'% Change'</em>, renderer: pctChange, dataIndex: <em>'pctChange'</em>},
  249. {header: <em>'Last Updated'</em>, width: 85,
  250. renderer: Ext.util.Format.dateRenderer(<em>'m/d/Y'</em>),
  251. dataIndex: <em>'lastChange'</em>}
  252. ],
  253. defaults: {
  254. sortable: true,
  255. width: 75
  256. }
  257. }),
  258. autoExpandColumn: <em>'company'</em>, <i>// match the id specified <b>in</b> the column model</i>
  259. height:350,
  260. width:600,
  261. title:<em>'Array Grid'</em>,
  262. tbar: [{
  263. text: <em>'Add Record'</em>,
  264. handler : <b>function</b>(){
  265. <b>var</b> defaultData = {
  266. change: 0,
  267. company: <em>'New Company'</em>,
  268. lastChange: (<b>new</b> Date()).clearTime(),
  269. pctChange: 0,
  270. price: 10
  271. };
  272. <b>var</b> recId = 3; <i>// provide unique id</i>
  273. <b>var</b> p = <b>new</b> store.recordType(defaultData, recId); <i>// create <b>new</b> record</i>
  274. grid.stopEditing();
  275. store.<a href="output/Ext.data.Store.html#Ext.data.Store-insert" ext:member="insert" ext:cls="Ext.data.Store">insert</a>(0, p); <i>// insert a <b>new</b> record into the store (also see <a href="output/Ext.data.Store.html#Ext.data.Store-add" ext:member="add" ext:cls="Ext.data.Store">add</a>)</i>
  276. grid.startEditing(0, 0);
  277. }
  278. }]
  279. });</code></pre></div></div></td><td class="msource">Store</td></tr></tbody></table><a id="Ext.data.Store-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-Store"></a><b><a href="source/Store.html#cls-Ext.data.Store">Store</a></b>(&nbsp;<code>Object&nbsp;config</code>&nbsp;)
  280. <div class="mdesc"><div class="short">Creates a new Store.</div><div class="long">Creates a new Store.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>config</code> : Object<div class="sub-desc">A config object containing the objects needed for the Store to access data,
  281. and read the data into Records.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Store</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-add"></a><b><a href="source/Store.html#method-Ext.data.Store-add">add</a></b>(&nbsp;<code>Ext.data.Record[]&nbsp;records</code>&nbsp;)
  282. :
  283. void<div class="mdesc"><div class="short">Add Records to the Store and fires the add event. To add Records
  284. to the store from a remote source use load({add:tru...</div><div class="long">Add Records to the Store and fires the <a href="output/Ext.data.Store.html#Ext.data.Store-add" ext:member="add" ext:cls="Ext.data.Store">add</a> event. To add Records
  285. to the store from a remote source use <code><a href="output/Ext.data.Store.html#Ext.data.Store-load" ext:member="load" ext:cls="Ext.data.Store">load</a>({add:true})</code>.
  286. See also <code><a href="output/Ext.data.Store.html#Ext.data.Store-recordType" ext:member="recordType" ext:cls="Ext.data.Store">recordType</a></code> and <code><a href="output/Ext.data.Store.html#Ext.data.Store-insert" ext:member="insert" ext:cls="Ext.data.Store">insert</a></code>.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>records</code> : Ext.data.Record[]<div class="sub-desc">An Array of Ext.data.Record objects
  287. to add to the cache. See <a href="output/Ext.data.Store.html#Ext.data.Store-recordType" ext:member="recordType" ext:cls="Ext.data.Store">recordType</a>.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Store</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-addEvents"></a><b><a href="source/Observable.html#method-Ext.util.Observable-addEvents">addEvents</a></b>(&nbsp;<code>Object|String&nbsp;o</code>,&nbsp;<code>string&nbsp;Optional.</code>&nbsp;)
  288. :
  289. void<div class="mdesc"><div class="short">Adds the specified events to the list of events which this Observable may fire.</div><div class="long">Adds the specified events to the list of events which this Observable may fire.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>o</code> : Object|String<div class="sub-desc">Either an object with event names as properties with a value of <code>true</code>
  290. or the first event name string if multiple event names are being passed as separate parameters.</div></li><li><code>Optional.</code> : string<div class="sub-desc">Event name if multiple event names are being passed as separate parameters.
  291. Usage:<pre><code>this.addEvents(<em>'storeloaded'</em>, <em>'storecleared'</em>);</code></pre></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addEvents" ext:member="#addEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.util.Observable-addListener"></a><b><a href="source/Observable.html#method-Ext.util.Observable-addListener">addListener</a></b>(&nbsp;<code>String&nbsp;eventName</code>,&nbsp;<code>Function&nbsp;handler</code>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;scope</code>]</span>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;options</code>]</span>&nbsp;)
  292. :
  293. void<div class="mdesc"><div class="short">Appends an event handler to this object.</div><div class="long">Appends an event handler to this object.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to listen for.</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
  294. <b>If omitted, defaults to the object which fired the event.</b></div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration.
  295. properties. This may contain any of the following properties:<ul>
  296. <li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
  297. <b>If omitted, defaults to the object which fired the event.</b></div></li>
  298. <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>
  299. <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>
  300. <li><b>buffer</b> : Number<div class="sub-desc">Causes the handler to be scheduled to run in an <a href="output/Ext.util.DelayedTask.html" ext:cls="Ext.util.DelayedTask">Ext.util.DelayedTask</a> delayed
  301. by the specified number of milliseconds. If the event fires again within that time, the original
  302. handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
  303. <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>
  304. if the event was bubbled up from a child Observable.</div></li>
  305. </ul><br>
  306. <p>
  307. <b>Combining Options</b><br>
  308. Using the options argument, it is possible to combine different types of listeners:<br>
  309. <br>
  310. A delayed, one-time listener.
  311. <pre><code>myDataView.on(<em>'click'</em>, this.onClick, this, {
  312. single: true,
  313. delay: 100
  314. });</code></pre>
  315. <p>
  316. <b>Attaching multiple handlers in 1 call</b><br>
  317. The method also allows for a single argument to be passed which is a config object containing properties
  318. which specify multiple handlers.
  319. <p>
  320. <pre><code>myGridPanel.on({
  321. <em>'click'</em> : {
  322. fn: this.onClick,
  323. scope: this,
  324. delay: 100
  325. },
  326. <em>'mouseover'</em> : {
  327. fn: this.onMouseOver,
  328. scope: this
  329. },
  330. <em>'mouseout'</em> : {
  331. fn: this.onMouseOut,
  332. scope: this
  333. }
  334. });</code></pre>
  335. <p>
  336. Or a shorthand syntax:<br>
  337. <pre><code>myGridPanel.on({
  338. <em>'click'</em> : this.onClick,
  339. <em>'mouseover'</em> : this.onMouseOver,
  340. <em>'mouseout'</em> : this.onMouseOut,
  341. scope: this
  342. });</code></pre></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addListener" ext:member="#addListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-addSorted"></a><b><a href="source/Store.html#method-Ext.data.Store-addSorted">addSorted</a></b>(&nbsp;<code>Ext.data.Record&nbsp;record</code>&nbsp;)
  343. :
  344. void<div class="mdesc"><div class="short">(Local sort only) Inserts the passed Record into the Store at the index where it
  345. should go based on the current sort ...</div><div class="long">(Local sort only) Inserts the passed Record into the Store at the index where it
  346. should go based on the current sort information.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>record</code> : Ext.data.Record<div class="sub-desc"></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Store</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-clearFilter"></a><b><a href="source/Store.html#method-Ext.data.Store-clearFilter">clearFilter</a></b>(&nbsp;<code>Boolean&nbsp;suppressEvent</code>&nbsp;)
  347. :
  348. void<div class="mdesc"><div class="short">Revert to a view of the Record cache with no filtering applied.</div><div class="long">Revert to a view of the Record cache with no filtering applied.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>suppressEvent</code> : Boolean<div class="sub-desc">If <tt>true</tt> the filter is cleared silently without firing the
  349. <a href="output/Ext.data.Store.html#Ext.data.Store-datachanged" ext:member="datachanged" ext:cls="Ext.data.Store">datachanged</a> event.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Store</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-collect"></a><b><a href="source/Store.html#method-Ext.data.Store-collect">collect</a></b>(&nbsp;<code>String&nbsp;dataIndex</code>,&nbsp;<span title="Optional" class="optional">[<code>Boolean&nbsp;allowNull</code>]</span>,&nbsp;<span title="Optional" class="optional">[<code>Boolean&nbsp;bypassFilter</code>]</span>&nbsp;)
  350. :
  351. Array<div class="mdesc"><div class="short">Collects unique values for a particular dataIndex from this store.</div><div class="long">Collects unique values for a particular dataIndex from this store.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>dataIndex</code> : String<div class="sub-desc">The property to collect</div></li><li><code>allowNull</code> : Boolean<div class="sub-desc">(optional) Pass true to allow null, undefined or empty string values</div></li><li><code>bypassFilter</code> : Boolean<div class="sub-desc">(optional) Pass true to collect from all records, even ones which are filtered</div></li></ul><strong>Returns:</strong><ul><li><code>Array</code><div class="sub-desc">An array of the unique values</div></li></ul></div></div></div></td><td class="msource">Store</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-commitChanges"></a><b><a href="source/Store.html#method-Ext.data.Store-commitChanges">commitChanges</a></b>()
  352. :
  353. void<div class="mdesc"><div class="short">Commit all Records with outstanding changes. To handle updates for changes,
  354. subscribe to the Store's update event, an...</div><div class="long">Commit all Records with <a href="output/Ext.data.Store.html#Ext.data.Store-getModifiedRecords" ext:member="getModifiedRecords" ext:cls="Ext.data.Store">outstanding changes</a>. To handle updates for changes,
  355. subscribe to the Store's <a href="output/Ext.data.Store.html#Ext.data.Store-update" ext:member="update" ext:cls="Ext.data.Store">update event</a>, and perform updating when the third parameter is
  356. Ext.data.Record.COMMIT.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Store</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-destroy"></a><b><a href="source/Store.html#method-Ext.data.Store-destroy">destroy</a></b>()
  357. :
  358. void<div class="mdesc"><div class="short">Destroys the store.</div><div class="long">Destroys the store.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Store</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi">&nbsp;</a></td><td class="sig"><a id="Ext.data.Store-each"></a><b><a href="source/Store.html#method-Ext.data.Store-each">each</a></b>(&nbsp;<code>Function&nbsp;fn</code>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;scope</code>]</span>&nbsp;)
  359. :
  360. void<div class="mdesc"><div class="short">Calls the specified function for each of the Records in the cache.</div><div class="long">Calls the specified function for each of the <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Records</a> in the cache.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>fn</code> : Function<div class="sub-desc">The function to call. The <a href="output/Ext.data.Record.html" ext:cls="Ext.data.Record">Record</a> is passed as the first parameter.
  361. Returning <tt>false</tt> aborts and exits the iteration.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code>this</code>