PDA

View Full Version : How to set Title to borderlayout for code?



franklt69
25 Dec 2006, 4:12 PM
Hi I need to change the title in a Boderloyout I did it but donīt work I have a borderlayout, in the west region I have 4 controlpanel I want to show in the titlebar a text different to the text in each contentpanel, how to do it?, I get the event activate for the contentpanel and tried to change the title bar but donīt work what is wrong?


// create the main layout
layout = new YAHOO.ext.BorderLayout(document.body, {
north: {
split:false,
initialSize: 25,
titlebar: false
},
west: {
split:true,
initialSize: 200,
minSize: 175,
maxSize: 400,
tabPosition: 'top',
titlebar: true,
collapsible: true,
animate: true,
autoScroll:true,
useShim:true,
cmargins: {top:0,bottom:2,right:2,left:2}
},
east: {
split:true,
initialSize: 200,
minSize: 175,
maxSize: 400,
titlebar: true,
title: "Firm Center",
collapsible: true,
animate: true,
autoScroll:false,
useShim:true,
collapsed:true,
cmargins: {top:0,bottom:2,right:2,left:2}
},
south: {
split:false,
initialSize: 22,
titlebar: false,
collapsible: false,
animate: false
},
center: {
titlebar: false,
autoScroll:true,
tabPosition: 'top',
closeOnTab: true,
alwaysShowTabs: false,
resizeTabs: true
}
});


layout.beginUpdate();
//header
layout.add('north', new YAHOO.ext.ContentPanel('header'));


//add search
leftMenuFirm = new YAHOO.ext.ContentPanel('firm', {title: 'Firm', fitToFrame:true});
south = layout.getRegion('west');
south.add(leftMenuFirm);

............
.........

leftMenuFirm.on('activate', function(){

layout.titleTextEl = "Firm Center";
//leftMenuFirm.getEl().repaint();
layout.getEl().repaint();
});

I would like to Appear in this ContentPanel Firm and the title bar "Firm Center" is possible to do it?

please any hint

kind regards
Frank

jack.slocum
25 Dec 2006, 6:17 PM
You asked this yesterday and I posted an answer.

http://www.yui-ext.com/forum/viewtopic.php?p=7139

franklt69
26 Dec 2006, 5:58 AM
OK Jack, sorry I don't watched the first message when I did the second post, now I want to have a different Hint for each contentpanel (CP), but I don't watch where setup the hint in the CP,
I would like to have a hint different to the title in the CP for instance the title in the content panes is "Staff" I want a hint like "Here you can setup the Staff" any hint please

kind regards
Frank

jack.slocum
26 Dec 2006, 2:55 PM
Building on the other code where we have a reference to the west region...

west.getTabs().getTab(panel.getId()).setTooltip('Blah blah blah');