Created
March 6, 2012 22:19
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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