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-JsonPStore-method-constructor'><span id='Ext-data-JsonPStore'>/**
19 </span></span> * @class Ext.data.JsonPStore
20 * @extends Ext.data.Store
23 * <p><b>NOTE:</b> This class is in need of migration to the new API.</p>
24 * <p>Small helper class to make creating {@link Ext.data.Store}s from different domain JSON data easier.
25 * A JsonPStore will be automatically configured with a {@link Ext.data.reader.Json} and a {@link Ext.data.proxy.JsonP JsonPProxy}.</p>
26 * <p>A store configuration would be something like:<pre><code>
27 var store = new Ext.data.JsonPStore({
33 url: 'get-images.php',
38 fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
40 * </code></pre></p>
41 * <p>This store is configured to consume a returned object of the form:<pre><code>
44 {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
45 {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
48 * </code></pre>
49 * <p>Where stcCallback is the callback name passed in the request to the remote domain. See {@link Ext.data.proxy.JsonP JsonPProxy}
50 * for details of how this works.</p>
51 * An object literal of this form could also be used as the {@link #data} config option.</p>
52 * <p><b>*Note:</b> Although not listed here, this class accepts all of the configuration options of
53 * <b>{@link Ext.data.reader.Json JsonReader}</b> and <b>{@link Ext.data.proxy.JsonP JsonPProxy}</b>.</p>
55 * @param {Object} config
58 Ext.define('Ext.data.JsonPStore', {
59 extend: 'Ext.data.Store',
60 alias : 'store.jsonp',
62 <span id='Ext-data-JsonPStore-cfg-reader'> /**
63 </span> * @cfg {Ext.data.DataReader} reader @hide
65 constructor: function(config) {
66 this.callParent(Ext.apply(config, {
67 reader: Ext.create('Ext.data.reader.Json', config),
68 proxy : Ext.create('Ext.data.proxy.JsonP', config)