This the model that I want to create using json file
Ext.define('Users', {
extend: 'Ext.data.Model',
fields: [{name: 'user_id', type: 'int'},
{name: 'user_name', type: 'string'}]
});
What do I have to do in order to automatically create this model, based on the content of a json response from the server?
In order to have the model created automatically, you need to include the
metaDatafield with your Json data.metaDatacan be used to describe all of the fields for the Model.In the ExtJS 4.1 documentation – Ext.data.reader.Json has a section called Response MetaData which describes basic use of this feature.