Skip to content

Instantly share code, notes, and snippets.

@iolo
Created September 11, 2012 08:40
Show Gist options
  • Save iolo/3696954 to your computer and use it in GitHub Desktop.
Save iolo/3696954 to your computer and use it in GitHub Desktop.
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{name: 'name', type: 'string'},
{name: 'age', type: 'int'},
{name: 'pic', type: 'string'}
]
});
var myStore = Ext.create('Ext.data.Store', {
model: 'User',
proxy: {
type: 'ajax',
url : '/users.json',
reader: {
type: 'json',
root: 'users'
}
},
autoLoad: true
});
Ext.create('Ext.DataView', {
fullscreen: true,
store: myStore,
itemTpl: '<img src="{pic}" /><h2>{name}</h2><p>{age} years old</p>'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment