Hei我有一個關於Sencha Touch XML列表的問題。Sencha Touch XML列表
我加載某些XML在煎茶觸摸,我想將其顯示爲一個列表:
這裏是我的代碼: 煎茶:
Ext.setup({
onReady: function() {
Ext.regModel('navModel', {
fields: [
{name:'id'},
{name:'title'}
]
});
var navi = new Ext.data.Store({
autoLoad:true,
model: 'navModel',
method: 'POST',
proxy: {
type: 'ajax',
url : 'navi.xml',
reader: {
type : 'xml',
root: 'menu',
record:'navigation'
}
}
});
var something = new Ext.List({
store: 'navi',
title: 'asdfasdf',
emptyText: 'No data',
fulscreen: true,
itemTpl: '{id} - {title}'
});
var rootPanel = new Ext.TabPanel({
fullscreen:true,
items:[something]
});
}
});
XML:
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<navigation>
<id>1</id>
<title>Hello</title>
</navigation>
<navigation>
<id>2</id>
<title>Test</title>
</navigation>
</menu>
我可以讀取XML但它不會顯示在列表中..出現了什麼問題?
THX答案
可否請您詳細說明答案 – Thomas 2013-04-21 08:27:15