app.js 791 B

1234567891011121314151617181920212223242526
  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. var userStore;
  13. Ext.require('Ext.data.Store');
  14. Ext.onReady(function() {
  15. userStore = Ext.create('Ext.data.Store', {
  16. model: 'User',
  17. data: [
  18. {firstName: 'Ed', lastName: 'Spencer'},
  19. {firstName: 'Tommy', lastName: 'Maintz'},
  20. {firstName: 'Aaron', lastName: 'Conran'},
  21. {firstName: 'Jamie', lastName: 'Avins'}
  22. ]
  23. });
  24. });