PDA

View Full Version : how set different titlebar text and title?



franklt69
24 Dec 2006, 7:09 AM
Hi I have this layout setup:

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}
},

leftMenuStaff = new YAHOO.ext.ContentPanel('staff', {title: 'Staff Center', fitToFrame:true});
south = layout.getRegion('west');
south.add(leftMenuStaff);

I want to appear in the title bar "Staff Center" and in the tab I want to appear "Staff" how I can setup it?



kind regards
Frank

franklt69
24 Dec 2006, 7:28 AM
More clear:

The titlebar is overrides for panel titles I donīt want it, I have four ContentPanel with title:

ContentPanel Title: Firm I want Titlebar: Firm Information
ContentPanel Title: Staff I want Titlebar: Staff Center
...
ContentPanel Title: Security I want Titlebar: Setup Security Center

How I can do it please

kind regards
Frank

jack.slocum
24 Dec 2006, 8:35 PM
Having two titles isn't currently built in but could be done pretty easily:



var west = layout.getRegion('west');
west.updateTitle = function(){
var ap = this.activePanel;
this.titleTextEl.innerHTML = ap ? ap.regionTitle : " ";
}


That space is really & # 1 6 0; (without the spaces). The forum converts it. The null check probably isn't required but is there for safety.

Then for each ContentPanel, set your new regionTitle config value:


var staff = new YAHOO.ext.ContentPanel('staff', {title: 'Staff', regionTitle: 'Staff Center', fitToFrame:true});