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