PDA

View Full Version : setTitle on a Collapsed BorderLayout Region



skirtle
23 Dec 2011, 3:42 PM
setTitle doesn't update the title on a collapsed region in a border layout. This works in 4.0.7.


Ext.onReady(function() {
var count = 1;

var panel = Ext.create('Ext.panel.Panel', {
height: 200,
layout: 'border',
renderTo: Ext.getBody(),
width: 200,
items: [
{
region: 'center',
items: {
text: 'Update',
xtype: 'button',
handler: function() {
Ext.getCmp('west').setTitle('Count: ' + count++);
}
}
}, {
collapsed: true,
collapsible: true,
id: 'west',
region: 'west',
title: 'West',
width: 100
}
]
});
});

dongryphon
23 Dec 2011, 9:46 PM
setTitle doesn't update the title on a collapsed region in a border layout. This works in 4.0.7.

Thanks.

EXTJSIV-4868

dongryphon
23 Dec 2011, 10:10 PM
Fix applied.

Something like this should work around the problem for now:



Ext.define('Ext.patch.PanelSetTitle', {
override: 'Ext.panel.Panel',

setTitle: function (title) {
var placeholder = this.placeholder;
if (placeholder) {
placeholder.setTitle(title);
}

this.callParent(arguments);
}
});