PDA

View Full Version : Problem with Border Layout



Chris55
23 Sep 2009, 7:11 AM
My layout is not rendering and would like some assistance as to why it isn't. Thank you for the assistance.

application.js


Ext.BLANK_IMAGE_URL = 'ext/ext-3.0.0/resources/images/default/s.gif';
Ext.ns('Application');

var page = {};
page.init = function()
{

this.viewport = new Ext.Viewport({
id: 'page-viewport'
,layout: 'border'
,title: 'Console Name'
,items: [
{
region: 'north'
,id: 'north-panel'
,tbar: new Ext.Toolbar({
height: 23
,items: ["North Toolbar"]
})
}
,{
region: 'south'
,id: 'south-panel'
,margin: '0 0 0 0'
,tbar: new Ext.Toolbar(
{
height: 23
,items: ["South Toolbar"]
}
)
}
,{
id: 'layout-browser'
,region:'west'
,border: false
,split:true
,margins: '2 0 5 5'
,width: 190
,minSize: 100
,maxSize: 500
,layout: {
type: 'accordion',
animate: true
}
,items: [
{
title: 'Treeview'
,html: '<p>TreeView to go here.</p>'
,border: false
}
,{
title: 'Notifications'
,html: '<p>Notifications to go here.</p>'
,border: false
}
]
}
,{
id: 'content-panel'
,region: 'center'
,layout: 'card',
layoutConfig: {deferredRender: false}
,margins: '2 5 5 0'
,activeItem: 0,
border: false,
items: [
{
id: 'start-panel',
title: 'Start Page',
layout: 'fit',
bodyStyle: 'padding:25px'
,contentEl: 'start-div'
}
]
}
]
/*,renderTo: Ext.getBody()*/
}); // eo Viewport instance

};// eo function page.init

Ext.onReady(page.init(), page, true);

aconran
23 Sep 2009, 7:19 AM
Ext.onReady(page.init(), page, true);

Remove the part in red. You are immediately invoking init regardless of when the page is ready and therefore probably causing errors. Do you receive any errors that popup in IE and/or in the console in Firefox?

Also, your panel's contained within the north and south regions need to specify a height.

Chris55
23 Sep 2009, 8:29 AM
Thanks, that did the trick. Actually, I did not get an error in FF - the page just didn't render.



Ext.onReady(page.init(), page, true);Remove the part in red. You are immediately invoking init regardless of when the page is ready and therefore probably causing errors. Do you receive any errors that popup in IE and/or in the console in Firefox?

Also, your panel's contained within the north and south regions need to specify a height.