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; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-data-JsonStore'>/**
19 </span> * @author Ed Spencer
20 * @class Ext.data.JsonStore
21 * @extends Ext.data.Store
24 * <p>Small helper class to make creating {@link Ext.data.Store}s from JSON data easier.
25 * A JsonStore will be automatically configured with a {@link Ext.data.reader.Json}.</p>
27 * <p>A store configuration would be something like:</p>
29 <pre><code>
30 var store = new Ext.data.JsonStore({
37 url: 'get-images.php',
45 //alternatively, a {@link Ext.data.Model} name can be given (see {@link Ext.data.Store} for an example)
46 fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
48 </code></pre>
50 * <p>This store is configured to consume a returned object of the form:<pre><code>
53 {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
54 {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
57 </code></pre>
59 * <p>An object literal of this form could also be used as the {@link #data} config option.</p>
63 Ext.define('Ext.data.JsonStore', {
64 extend: 'Ext.data.Store',
67 <span id='Ext-data-JsonStore-cfg-reader'> /**
68 </span> * @cfg {Ext.data.DataReader} reader @hide
70 constructor: function(config) {
71 config = config || {};
81 this.callParent([config]);