Sencha touch 如何在sencha touch mobile中解析下面提到的本地xml文件
拥有一个具有xml属性的模型和一个具有xml代理的存储Sencha touch 如何在sencha touch mobile中解析下面提到的本地xml文件,sencha-touch,extjs,Sencha Touch,Extjs,拥有一个具有xml属性的模型和一个具有xml代理的存储 As i am new to Sencha touch mobile stuck in parsing a normal xml file and pass it to a store object and populate in a panel view. Can any one help me out how to parse a XML file kept locally in the project(as mentioned bel
As i am new to Sencha touch mobile stuck in parsing a normal xml file and pass it to a store object and populate in a panel view. Can any one help me out how to parse a XML file kept locally in the project(as mentioned below data.xml) or as a string. Below is the XML and thanks in advance.
data.XML:-
<dataSrc>
<section>
<elem>
<id>1677</id>
<name>
<![CDATA[ United Kingdom]]>
</name>
</elem>
</section>
<section>
<elem>
<id>1678</id>
<name>
<![CDATA[ United Arab Emirates]]>
</name>
</elem>
</section>
.......
</dataSrc>
然后在存储中解析xml的内容。阅读所有关于这方面的文章
Ext.regModel('elem', {
fields: [
{name: 'id', type: 'string'},
{name: 'name', type: 'string'}
]
});
var myStore = new Ext.data.Store({
model: 'elem',
proxy: {
type: 'xml',
url : '/data.xml',
reader: {
type: 'xml',
root: 'dataSrc',
record: 'elem'
}
},
autoLoad: true
});