PDA

View Full Version : NestedList Items won't show



TDeBailleul
25 Oct 2011, 1:36 AM
Hi everyone,

I'm trying to create the nestlist from that tutorial : http://vimeo.com/20580117

For now, it only shows the toolbar of the list with the title, but list items won't show and this is pretty urgent...

Here is what I have :

app/app.js :



Ext.regApplication({
name: 'NestedListDemo',
launch: function() {
this.launched = true;
this.mainLaunch();
},


mainLaunch: function() {


if (!device || !this.launched) {
return;
}
this.views.viewport = new this.views.Viewport();
}
});



app/models/list_item.js



Ext.regModel('ListItem', {
fields: [
{name: 'text', type: 'string'},
{name: 'info', type: 'string'},
{name: 'model', type: 'string'},
{name: 'items', type: 'auto'},
{name: 'duration', type: 'auto'},
]
});



app/stores/music_store.js



NestedListDemo.stores.music_store = new Ext.data.TreeStore({
model: 'ListItem',
proxy: {
type: 'ajax',
url: '/data/tracks.json',
reader: {
type: 'tree',
root: 'items'
}
}
});



app/views/Viewport.js


NestedListDemo.views.Viewport = Ext.extend(Ext.NestedList, {
title: 'Actualité',
fullscreen: true,
displayField: 'text',
store: NestedListDemo.stores.music_store
});




index.html



<script type="text/javascript" src="app/app.js"></script>
<script type="text/javascript" src="app/models/list_item.js"></script>
<script type="text/javascript" src="app/stores/music_store.js"></script>
<script type="text/javascript" src="app/views/Viewport.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready", NestedListDemo.mainLaunch, false);
</script>



Thank you for your help

TDeBailleul
25 Oct 2011, 1:37 AM
Obviously, I also have a valid app/data/tracks.json taken from the GitHub given below the tutorial video.

TDeBailleul
27 Oct 2011, 10:38 AM
Up. Please it's really urgent.

I've been trying to find the error for hours but found nothing.
If you could just take a look at the code, even to tell that there is nothing wrong, that would be helpful.

Thanks you