我正在使用Sencha Touch編寫應用程序。所以我讀了一個XML文件並將數據放在列表視圖中。不幸的是,我的應用程序不顯示任何列表項。我在控制檯日誌中沒有錯誤,並且根據文檔完成了所有工作。Sencha Touch不顯示XML數據
app.js:
FRANF = new Ext.Application({
name: 'FRANF',
useLoadMask: true,
launch: function() {
FRANF.homescreenList = new Ext.List({
store: FRANF.ListStore,
itemTpl: '<div>{id} {name}</div>'
});
FRANF.homescreenListToolbar = new Ext.Toolbar({
id: 'homescreenToolbar',
title: 'FRA NF'
});
FRANF.homescreenListContainer = new Ext.Panel({
id : 'itemListContainer',
layout : 'fit',
html: 'This is the notes list container',
dockedItems: [FRANF.homescreenListToolbar],
items: [FRANF.homescreenList]
});
FRANF.viewport = new Ext.Panel({
fullscreen : true,
layout : 'card',
cardAnimation : 'slide',
items: [FRANF.homescreenListContainer]
});
}
});
index.js:
Ext.regModel('Contact', {
fields: ['id', 'name']
});
FRANF.ListStore = new Ext.data.TreeStore({
model: 'Contact',
autoLoad: true,
proxy: {
type: 'ajax',
url : 'homescreen.xml',
reader: {
type: 'xml',
root: 'items',
record: 'item'
}
}
});
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<items>
<item>
<id>main-contacts</id>
<name>Kontakte FRA NF</name>
</item>
<item>
<id>important-numbers</id>
<name>Lufthansa-Nummern A-Z</name>
</item>
<item>
<id>who-does-what</id>
<name>Was finde ich wo?</name>
</item>
</items>
錯誤控制檯說,XML文件加載正確。
你可以看到我的測試應用程序的位置:My Sencha Touch App
沒有答案比這更好。你應得的+50。 – riship89 2012-02-07 07:55:32
嘿,請參閱此... http://stackoverflow.com/questions/9563417/how-to-consume-soap-web-service-in-sencha-touch。 並嘗試回答它... – himanshu 2012-03-06 11:34:36
停止垃圾郵件到處! – ilija139 2012-03-06 18:07:48