4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../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-method-constructor'><span id='Ext-data-JsonStore'>/**
19 </span></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>
62 * @param {Object} config
65 Ext.define('Ext.data.JsonStore', {
66 extend: 'Ext.data.Store',
69 <span id='Ext-data-JsonStore-cfg-reader'> /**
70 </span> * @cfg {Ext.data.DataReader} reader @hide
72 constructor: function(config) {
73 config = config || {};
83 this.callParent([config]);