lekraken
28 Jan 2011, 3:35 AM
Hi,
I try to set a panel as a leaf in a nestedList and I not understand what's wrong with my code. Someone know why ?
Thanks a lot,
// store with data
var data = {
text: 'Categorie',
items: [{
text: 'Gamme Route',
items: [{
text: 'Blousons/Vestes',
items: [{
text: 'Blouson cuir steeve noir',
items: [{
xtype:'panel',
layout:'card',
style:'background-color:black;',
html:'<div id="calendar">test</div>'
}]
}]
},{
text: 'Pantalons',
leaf: true
},{
text: 'Gants',
leaf: true
},{
text: 'Bottes',
leaf: true
},{
text: 'Casques',
leaf: true
},{
text: 'Equipement pluie',
leaf: true
},{
text: 'Sportwear',
leaf: true
},{
text: 'Divers',
leaf: true
}]
},{
text: 'Gamme Tout Terrain',
items: [{
text: 'Pantalons',
leaf: true
},{
text: 'Maillots',
leaf: true
},{
text: 'Bottes',
leaf: true
},{
text: 'Casques',
leaf: true
},{
text: 'Divers',
leaf: true
}]
},{
text: 'Accessoires Motos',
items: [{
text: 'Bulle/Pare-brise',
leaf: true
},{
text: 'Chromes',
leaf: true
},{
text: 'Carénages',
leaf: true
},{
text: 'Divers',
leaf: true
},{
text: 'Sac/Sacoches',
leaf: true
}]
}]
};
Ext.regModel('ListItem', {
fields: [{name: 'text', type: 'string'}]
});
var store = new Ext.data.TreeStore({
model: 'ListItem',
root: data,
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
}
});
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {
var nestedList = new Ext.NestedList({
fullscreen: true,
title: 'Categorie',
displayField: 'text',
backText: '<',
store: store
});
}
});
I try to set a panel as a leaf in a nestedList and I not understand what's wrong with my code. Someone know why ?
Thanks a lot,
// store with data
var data = {
text: 'Categorie',
items: [{
text: 'Gamme Route',
items: [{
text: 'Blousons/Vestes',
items: [{
text: 'Blouson cuir steeve noir',
items: [{
xtype:'panel',
layout:'card',
style:'background-color:black;',
html:'<div id="calendar">test</div>'
}]
}]
},{
text: 'Pantalons',
leaf: true
},{
text: 'Gants',
leaf: true
},{
text: 'Bottes',
leaf: true
},{
text: 'Casques',
leaf: true
},{
text: 'Equipement pluie',
leaf: true
},{
text: 'Sportwear',
leaf: true
},{
text: 'Divers',
leaf: true
}]
},{
text: 'Gamme Tout Terrain',
items: [{
text: 'Pantalons',
leaf: true
},{
text: 'Maillots',
leaf: true
},{
text: 'Bottes',
leaf: true
},{
text: 'Casques',
leaf: true
},{
text: 'Divers',
leaf: true
}]
},{
text: 'Accessoires Motos',
items: [{
text: 'Bulle/Pare-brise',
leaf: true
},{
text: 'Chromes',
leaf: true
},{
text: 'Carénages',
leaf: true
},{
text: 'Divers',
leaf: true
},{
text: 'Sac/Sacoches',
leaf: true
}]
}]
};
Ext.regModel('ListItem', {
fields: [{name: 'text', type: 'string'}]
});
var store = new Ext.data.TreeStore({
model: 'ListItem',
root: data,
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
}
});
Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {
var nestedList = new Ext.NestedList({
fullscreen: true,
title: 'Categorie',
displayField: 'text',
backText: '<',
store: store
});
}
});