PDA

View Full Version : Default tab doesn't render with deferredRender:false in borderLayout



slemiere
18 Mar 2009, 4:11 AM
Hello,

When I load my page, the default tab doesn't render. When I change tab and then come back on the default tab, it has been rendered correctly (I can read 'Choose a message to see details.'). I tryed to use the doLayout on the viewPort but with no luck.
Thanks in advance !

Here is my code :


Ext.onReady(function(){
//An empty panel in the center
var panel = new Ext.Panel({
region: 'center'
});
//the tabs
var tabs = new Ext.TabPanel({
title: 'Details',
region: 'south',
height: 200,
collapsible: true,
collapseMode: 'mini',
split: true,
id: 'detail-panel',
activeItem: 0,
//if I put this to true it works
deferredRender: false,
items: [new Ext.Panel({
title: 'Message Details',
id: 'template-tab-detail-panel',
html: 'Choose a message to see details.'
}), basicPanel = new Ext.Panel({
title: 'View only Content',
id: 'basic-tab-detail-panel',
html: 'Choose a message to see details.'
})]
});
//The entire window
var viewport = new Ext.Viewport({
layout: 'border',
items: [tabs,panel]
});
});

cesarwbr
18 Mar 2009, 4:18 AM
put the property value of "html" in a div tag in you html, and do it:



Ext.onReady(function(){
//An empty panel in the center
var panel = new Ext.Panel({
region: 'center'
});
//the tabs
var tabs = new Ext.TabPanel({
title: 'Details',
region: 'south',
height: 200,
collapsible: true,
collapseMode: 'mini',
split: true,
id: 'detail-panel',
activeItem: 0,
//if I put this to true it works
deferredRender: false,
items: [new Ext.Panel({
title: 'Message Details',
id: 'template-tab-detail-panel',
contentEl: yourDiv
}), basicPanel = new Ext.Panel({
title: 'View only Content',
id: 'basic-tab-detail-panel',
contentEl: yourDiv
})]
});
//The entire window
var viewport = new Ext.Viewport({
layout: 'border',
items: [tabs,panel]
});
});

Animal
18 Mar 2009, 4:33 AM
activeTab: 0

slemiere
18 Mar 2009, 5:15 AM
Thank you Animal, works perfectly now :)