PDA

View Full Version : Custom Nested List



albertokstro
8 Jul 2010, 2:46 PM
Hi guys...


I need apply a Template to a NestedList,the of NestedList are loaded via JSon. The code into comment dont work...




This is the code :


Sorry for my bad english...:D


this.navigationPanel = new Ext.NestedList({
items: this.navigationItems || [],//this are loaded ok
dock: 'left',
width: 250,
//tpl: new Ext.XTemplate('<h1>{text}</h1><br/>'),
height: 456,

});

evant
8 Jul 2010, 7:19 PM
I'm not really sure what you're saying.

Could you elaborate?

albertokstro
8 Jul 2010, 7:50 PM
Hi Evant,

I have a nestedList looks like the kitchen sink, the data of the list is load via JSON,

i want to place another information like address or phone after the name of Hotel....i wanna customize the nestedList with a Template...

attach an image that explains my problem...

http://twitpic.com/23n4sm

Hablo espaƱol por si alguien me puede ayudar en mi idioma...;D
Thanks,

evant
8 Jul 2010, 8:05 PM
Ok, currently that functionality isn't supported. As such, you should just put that formatting into the item itself, eg:



Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {
var nestedList = new Ext.NestedList({
fullscreen: true,
items: [{
text: 'Option A',
items: [{
text: '<span style="color: red;">Option A.1</span>',
customAttribute: 123,
items: [{
text: 'Option A.1.a'
},{
text: 'Option A.1.b'
}]
},{
text: 'Option A.2',
customAttribute: 389
}]
},{
text: 'Option B',
items: [{
text: 'Option B.1',
customAttribute: 233
},{
text: 'Option B.2',
customAttribute: 2390
}]
},{
text: 'Option C',
items: [{
text: 'Option C.1',
customAttribute: 903
},{
text: 'Option C.2',
customAttribute: 77
}]
}]
});

nestedList.on('listchange', function(list, item) {
if (!item.items && item.text) {
alert('You chose the ' + item.text + ' item.');
}
});
}
});

albertokstro
8 Jul 2010, 8:22 PM
Thanks evant for your support!!

Take care...