im new to Sencha Touch 2, im trying to store values from json using store and models by proxy, but don't no where im wrong
My model
Ext.regModel('Product', {
fields: [
{name: 'name', type: 'string'},
{name: 'description', type: 'string'},
{name: 'price', type: 'float'},
{name: 'image_url', type: 'string'},
{name: 'in_stock', type: 'boolean'}
]
});
My store
Dzineapp.BlogStore = new Ext.data.Store({
model: 'Product',
autoLoad: false,
proxy: new Ext.data.AjaxProxy({
type: 'ajax',
url: 'http://localhost/products.json',
reader: {
type: 'json',
root: 'products'
},
writer: {
encode: true,
type: 'json'
}
})
});
Products.json
{
"products": [
{"name": "Some Product", "price": 9.99, "image_url": "product1.jpg", "in_stock": true},
{"name": "Another Product", "price": 7.50, "image_url": "product2.jpg", "in_stock": true},
{"name": "A third product", "price": 2.35, "image_url": "product3.jpg", "in_stock": false}
]
}
My Views
Dzineapp.blogPanel = new Ext.List({
id: 'bloglist',
store: Dzineapp.BlogStore,
itemTpl: '<div class="contact">{name}</div>'
});
But my App dosent show any values, any one can help me where im doing the mistake.. im just starter in sencha