preferred way to make a store
I have this model:
Code:
Ext.define('Article',{
extend: 'Ext.data.Model',
fields: [
{name:'Headline',type:'string'},
{name:'Summary',type:'string'},
{name:'Body',type:'string'},
{name:'Thumbs',type:'string',mapping:'Photos > Thumbnail'}
]
});
And this two ways to declare a store, the first one throws an error saying I'm trying to define a store with no model, the second works ok but can't get to it on the safari debugger, what's the difference between the two and which one should I use?
Code:
Ext.define('Articles_store',{
extend: 'Ext.data.Store',
model: 'Article',
proxy: {
type: 'ajax',
url: 'http://localhost:8080/data.xml',
reader: {
type: 'xml',
root: 'channel',
record: 'item'
}
},
autoLoad: true
})
var Articles_store = Ext.create('Ext.data.Store',{
model: 'Article',
proxy:{
type: 'ajax',
url: 'http://localhost:8080/data.xml',
reader: {
type: 'xml',
root: 'channel',
record: 'item'
}
},
autoLoad: true
});