Hi!
I want to add a Ext.List to a Ext.tab.Panel after the tabPanel has created.
My code:
TabPanel:
Code:
Ext.Viewport.add({
id: 'viewport',
xtype: 'tabpanel',
fullscreen: true,
tabBarPosition: 'bottom',
items: [
// This is the home page, just some simple html
{
title: 'Title',
iconCls: 'info',
cls: 'home',
html: [
'<br>',
'<div style="text-align:center;">',
'<img width=146 height=120 src="../logo.png" />',
'<br>',
'<h1>Title of App</h1>',
'</div>'
].join("")
},
{
title: 'List',
id: 'lista',
iconCls: 'bookmarks',
scrollable: true,
html: [
'<div id="lista">',
'<div style="text-align:center;"><br><br>Loading list...</div>',
'</div>'
].join("")
}
...... CONTINUE .....
My List:
Code:
var lista = Ext.create('Ext.List', {
fullscreen: true,
store: {
fields: ['name'],
data: [
{name: 'Cowper'},
{name: 'Everett'},
{name: 'University'},
{name: 'Forest'}
]
},
itemTpl: '{name}',
listeners: {
select: function(view, record) {
Ext.Msg.alert('Selected!', 'You selected ' + record.get('name'));
}
}
});
I want to replace / add the content of the "list" item in tabPanel with the content of Ext.List created later in second code...
Thanks!