PDA

View Full Version : Problem with bbar of a DataView inside a TabPanel



Urkman
18 Aug 2009, 10:57 PM
Hello,

I have some problems with a bbar of a DataView inside a TabPanel.
Here are some parts of my code:


Chat.ContentTab = new Ext.TabPanel( {
region:'center',
deferredRender:false,
activeTab:0,
margins : '0 0 0 2',
defaults: {
closable: false,
autoScroll: true
},
items: [{
id: 'chatMessagesTab',
title: 'Chat',
items: [{
xtype: 'chatMessagesDataView'
}]
},{
id: 'questionListTab',
title: 'Fragen',
items: [{
xtype: 'questionListDataView'
}]
}]
});
When I use this code for my TabPanel, the bbar is not fixed at the bottom of the Panel. It is under the List of entries inside the DataView and is scrolled with the list.

When I use this code:


Chat.ContentTab = new Ext.TabPanel( {
region:'center',
deferredRender:false,
activeTab:0,
margins : '0 0 0 2',
defaults: {
closable: false,
autoScroll: true
},

items: [
{xtype: 'chatMessagesDataView'},
{xtype: 'questionListDataView'}
]
});It works fine...

Why it is not working with the first version?
I need to use the first version, because I need to disable and enable the Panels programmically...

Thanks for your Help,
Urkman

J@y
18 Aug 2009, 11:14 PM
Overnested structure.

{} <---is already a panel component

{xtype: 'chatMessagesDataView'} <---dataView as an item of panel


{
id: 'chatMessagesTab',
title: 'Chat',
items: [{
xtype: 'chatMessagesDataView'
} <---------- panel > panel > dataView

Animal
18 Aug 2009, 11:30 PM
Hello,

I have some problems with a bbar of a DataView inside a TabPanel.
Here are some parts of my code:


Chat.ContentTab = new Ext.TabPanel( {
region:'center',
deferredRender:false,
activeTab:0,
margins : '0 0 0 2',
defaults: {
closable: false,
autoScroll: true
},
items: [{
id: 'chatMessagesTab',
title: 'Chat',
items: [{
xtype: 'chatMessagesDataView'
}]
},{
id: 'questionListTab',
title: 'Fragen',
items: [{
xtype: 'questionListDataView'
}]
}]
});
When I use this code for my TabPanel, the bbar is not fixed at the bottom of the Panel. It is under the List of entries inside the DataView and is scrolled with the list.

When I use this code:


Chat.ContentTab = new Ext.TabPanel( {
region:'center',
deferredRender:false,
activeTab:0,
margins : '0 0 0 2',
defaults: {
closable: false,
autoScroll: true
},

items: [
{xtype: 'chatMessagesDataView'},
{xtype: 'questionListDataView'}
]
});It works fine...

Why it is not working with the first version?
I need to use the first version, because I need to disable and enable the Panels programmically...

Thanks for your Help,
Urkman


You don't need the overnested first.

Yuu need



Chat.ContentTab = new Ext.TabPanel( {
region:'center',
deferredRender:false,
activeTab:0,
margins : '0 0 0 2',
defaults: {
closable: false,
autoScroll: true
},

items: [{
id: 'chatMessagesTab',
xtype: 'chatMessagesDataView',
title: 'Chat'
}, {
id: 'questionListTab',
xtype: 'questionListDataView',
title: 'Fragen'
}]
});



{...} is a Panel.

And if you do not think about the layout of a Panel, then how would you hope that any child items you put in there get sized?

Urkman
19 Aug 2009, 12:34 AM
Hello,

thanks for your help. Now it works :-)

Greetings,
Urkman

Animal
19 Aug 2009, 12:35 AM
Do you understand what just happened, or can we expect this to happen again?