DirectStore.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-data-DirectStore'>/**
  19. </span> * Small helper class to create an {@link Ext.data.Store} configured with an {@link Ext.data.proxy.Direct}
  20. * and {@link Ext.data.reader.Json} to make interacting with an {@link Ext.direct.Manager} server-side
  21. * {@link Ext.direct.Provider Provider} easier. To create a different proxy/reader combination create a basic
  22. * {@link Ext.data.Store} configured as needed.
  23. *
  24. * **Note:** Although they are not listed, this class inherits all of the config options of:
  25. *
  26. * - **{@link Ext.data.Store Store}**
  27. *
  28. * - **{@link Ext.data.reader.Json JsonReader}**
  29. *
  30. * - **{@link Ext.data.reader.Json#cfg-root root}**
  31. * - **{@link Ext.data.reader.Json#idProperty idProperty}**
  32. * - **{@link Ext.data.reader.Json#totalProperty totalProperty}**
  33. *
  34. * - **{@link Ext.data.proxy.Direct DirectProxy}**
  35. *
  36. * - **{@link Ext.data.proxy.Direct#directFn directFn}**
  37. * - **{@link Ext.data.proxy.Direct#paramOrder paramOrder}**
  38. * - **{@link Ext.data.proxy.Direct#paramsAsHash paramsAsHash}**
  39. *
  40. */
  41. Ext.define('Ext.data.DirectStore', {
  42. /* Begin Definitions */
  43. extend: 'Ext.data.Store',
  44. alias: 'store.direct',
  45. requires: ['Ext.data.proxy.Direct'],
  46. /* End Definitions */
  47. constructor : function(config){
  48. config = Ext.apply({}, config);
  49. if (!config.proxy) {
  50. var proxy = {
  51. type: 'direct',
  52. reader: {
  53. type: 'json'
  54. }
  55. };
  56. Ext.copyTo(proxy, config, 'paramOrder,paramsAsHash,directFn,api,simpleSortMode');
  57. Ext.copyTo(proxy.reader, config, 'totalProperty,root,idProperty');
  58. config.proxy = proxy;
  59. }
  60. this.callParent([config]);
  61. }
  62. });
  63. </pre>
  64. </body>
  65. </html>