I am fairly new to extjs. I am declaring a model class "product". I am just not sure where the properties of this class go to? fields or config. With Sencha 4.1 adding fields to config would give me getters and setters but is it the correct approach? Which of the following two is the preferred way of defining model?
Ext.define('MyApp.model.product', {
extend: 'Ext.data.Model',,
config: {
color: '',
price: 0,
}
});
OR
Ext.define('MyApp.model.product', {
extend: 'Ext.data.Model',,
fields: [
"color",
"price"
]
});
Thanks,