Skip to content

Instantly share code, notes, and snippets.

@segphault
Created March 6, 2012 22:19
Show Gist options
  • Save segphault/1989397 to your computer and use it in GitHub Desktop.
Save segphault/1989397 to your computer and use it in GitHub Desktop.
Create an Ext JS store that processes data from Reddit's JSON API
Ext.define('MyApp.store.base.RedditStore', {
extend: 'Ext.data.Store',
config: {
storeId: 'MyJsonPStore',
proxy: {
type: 'jsonp',
url: 'http://www.reddit.com/hot.json',
callbackKey: 'jsonp',
reader: {
type: 'json',
rootProperty: 'data.children',
record: 'data'
}
},
fields: [
{
name: 'title'
},
{
name: 'author'
},
{
name: 'score'
},
{
dateFormat: 'timestamp',
name: 'created',
type: 'date'
}
]
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment