3 Attachment(s)
List doesn't load XmlStore...
on my browser. BUT it does on architect! Chrome's Command Line's clear. XML file's under data/products.xml. Working on Sencha Architect Version 2.1.0, Sencha cmd 3.0.0.250 n' Sencha Touch 2.1. Suggestions? why does architect can load xml store but my browser can't?
MyList:
Code:
Ext.define('MyApp.view.MyList', {
extend: 'Ext.dataview.List',
alias: 'widget.mylist',
config: {
title: 'Catalogo Productos',
store: 'MyXmlStore',
grouped: true,
onItemDisclosure: true,
itemTpl: [
'<div> Product: {name} Price: {price}</div>'
]
}
});
MyXmlStore:
Code:
Ext.define('MyApp.store.MyXmlStore', {
extend: 'Ext.data.Store',
alias: 'store.myxmlstore',
requires: [
'MyApp.model.product'
],
config: {
model: 'MyApp.model.product',
storeId: 'MyXmlStore',
proxy: {
type: 'ajax',
url: 'data/products.xml',
reader: {
type: 'xml',
record: 'Product'
}
}
}
});
product:
Code:
Ext.define('MyApp.model.product', {
extend: 'Ext.data.Model',
alias: 'model.product',
config: {
fields: [
{
name: 'name',
mapping: 'Name'
},
{
name: 'price',
mapping: 'Price'
},
{
name: 'imageData',
mapping: 'ImageData > Url'
}
]
}
});
products.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Products xmlns="http://example.org">
<Product>
<Name>Widget</Name>
<Price>11.95</Price>
<ImageData>
<Url>widget.png</Url>
<Width>300</Width>
<Height>400</Height>
</ImageData>
</Product>
<Product>
<Name>Sprocket</Name>
<Price>5.95</Price>
<ImageData>
<Url>sc.png</Url>
<Width>300</Width>
<Height>400</Height>
</ImageData>
</Product>
<Product>
<Name>Gadget</Name>
<Price>19.95</Price>
<ImageData>
<Url>widget.png</Url>
<Width>300</Width>
<Height>400</Height>
</ImageData>
</Product>
</Products>
Attachment 40061Attachment 40062Attachment 40063