X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/docs/guides/data/examples/inline_data/app.js diff --git a/docs/guides/data/examples/inline_data/app.js b/docs/guides/data/examples/inline_data/app.js new file mode 100644 index 00000000..b234e540 --- /dev/null +++ b/docs/guides/data/examples/inline_data/app.js @@ -0,0 +1,26 @@ +/** + * @example Inline Data + * + * This example creates a simple store that auto-loads its data from an ajax + * proxy. A global variable called "userStore" is created which is an instance of + * {@link Ext.data.Store}. Feel free to experiment with the "userStore" object on the console command line. + */ +Ext.define('User', { + extend: 'Ext.data.Model', + fields: ['firstName', 'lastName'] +}); + +var userStore; +Ext.require('Ext.data.Store'); +Ext.onReady(function() { + userStore = Ext.create('Ext.data.Store', { + model: 'User', + data: [ + {firstName: 'Ed', lastName: 'Spencer'}, + {firstName: 'Tommy', lastName: 'Maintz'}, + {firstName: 'Aaron', lastName: 'Conran'}, + {firstName: 'Jamie', lastName: 'Avins'} + ] + }); +}); +