PDA

View Full Version : adding headers to the columns for the portal example



mmasters
6 Mar 2008, 10:47 PM
I've been trying to add headers to the three columns in the Portal example. I've tried adding a 'title' attribute shown in the following code snippet, but this doesn't seem to work. Any pointers on how I can do this would be great.



...
},{
xtype:'portal',
title: 'Release',
region:'center',
margins:'35 5 5 0',
items:[{
title: 'column 1',
columnWidth:.33,
style:'padding:10px 0 10px 10px',
items:[{
title: 'Another Panel 1',
tools: tools,
html: Ext.example.shortBogusMarkup
}]
},{
title: 'column 2',
columnWidth:.33,
style:'padding:10px 0 10px 10px',
items:[{
title: 'Panel 2',
tools: tools,
html: Ext.example.shortBogusMarkup
},{
title: 'Another Panel 2',
tools: tools,
html: Ext.example.shortBogusMarkup
}]
},{
title: 'column 3',
columnWidth:.33,
style:'padding:10px',
items:[{
title: 'Panel 3',
tools: tools,
html: Ext.example.shortBogusMarkup
},{
title: 'Another Panel 3',
tools: tools,
html: Ext.example.shortBogusMarkup
}]
}]
}]
...

Condor
6 Mar 2008, 11:12 PM
Ext.ux.PortalColumn extends Ext.Container, so it doesn't have a title config option.

You'll have to create your own PortalColumn class that extends Ext.Panel, e.g.


Ext.ux.MyPortalColumn = Ext.extend(Ext.Panel, {
layout: 'anchor',
defaultType: 'portlet',
cls:'x-portal-column'
});
Ext.reg('portalcolumn', Ext.ux.MyPortalColumn);

mmasters
6 Mar 2008, 11:34 PM
Thanks for the reply! I changed it to extend Ext.Panel, but now all the portlets disappeared. Any idea why that happened?

Condor
6 Mar 2008, 11:43 PM
As you can see from my example you need to remove the autoEl:'div'.

mmasters
7 Mar 2008, 12:40 AM
Thanks!