Created
September 11, 2012 08:40
-
-
Save iolo/3696954 to your computer and use it in GitHub Desktop.
This file contains 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('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