Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / guides / data / examples / inline_data / app.js
1 /**
2  * @example Inline Data
3  *
4  * This example creates a simple store that auto-loads its data from an ajax
5  * proxy. A global variable called "userStore" is created which is an instance of
6  * {@link Ext.data.Store}. Feel free to experiment with the "userStore" object on the console command line.
7  */
8 Ext.define('User', {
9     extend: 'Ext.data.Model',
10     fields: ['firstName', 'lastName']
11 });
12
13 var userStore;
14 Ext.require('Ext.data.Store');
15 Ext.onReady(function() {
16     userStore = Ext.create('Ext.data.Store', {
17         model: 'User',
18         data: [
19             {firstName: 'Ed',    lastName: 'Spencer'},
20             {firstName: 'Tommy', lastName: 'Maintz'},
21             {firstName: 'Aaron', lastName: 'Conran'},
22             {firstName: 'Jamie', lastName: 'Avins'}
23         ]
24     });
25 });
26