3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.0
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
15 <div id="cls-Ext.data.JsonStore"></div>/**
16 * @class Ext.data.JsonStore
17 * @extends Ext.data.Store
18 * <p>Small helper class to make creating {@link Ext.data.Store}s from JSON data easier.
19 * A JsonStore will be automatically configured with a {@link Ext.data.JsonReader}.</p>
20 * <p>A store configuration would be something like:<pre><code>
21 var store = new Ext.data.JsonStore({
24 url: 'get-images.php',
29 fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
32 * <p>This store is configured to consume a returned object of the form:<pre><code>
35 {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
36 {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
40 * An object literal of this form could also be used as the {@link #data} config option.</p>
41 * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of
42 * <b>{@link Ext.data.JsonReader JsonReader}</b>.</p>
44 * @param {Object} config
47 Ext.data.JsonStore = Ext.extend(Ext.data.Store, {
48 <div id="cfg-Ext.data.JsonStore-reader"></div>/**
49 * @cfg {Ext.data.DataReader} reader @hide
51 constructor: function(config){
52 Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(config, {
53 reader: new Ext.data.JsonReader(config)
57 Ext.reg('jsonstore', Ext.data.JsonStore);</pre>