I am writing an application with Sencha Touch. So I read a XML file and put the data in a list view. Unfortunately, my app doesn't show any list items. I have no errors in my console log and I've done everything according to the documentation.
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>
The error console says that the XML file is loaded correctly.
You can see my test app here: My Sencha Touch App