JavaScript
Data
Run Code
Open in Fiddle
Ext.application({ name : 'Fiddle', launch : function() { Ext.define('User', { extend: 'Ext.data.Model', idProperty: 'userId', fields: [ 'userId', 'username' ], proxy: { type: 'ajax', idParam: 'userId', url: 'user.json', reader: { type: 'json' } } }, function(userClass){ // outputs 2 fields: userId, username console.log(userClass.getFields()); User.load(1, { success: function(userRecord){ console.log(userRecord); } }); }); } });