PDA

View Full Version : Insert displayfield in window header title bar



maneljn
22 Oct 2012, 2:09 AM
is it possible to insert a displayfield, centered in a window header title bar ?

Barzoy
22 Oct 2012, 4:03 AM
Not sure what it is perfectly centered, but it looks very much like :)



var w = new Ext.window.Window({
title: 'Window',
iconCls: 'no-icon',
width: 400,
height: 200
});

var insertPosition = 0;

if (w.title) {
insertPosition++;
}

if (w.iconCls || w.icon) {
insertPosition++;
}

w.show();

w.getHeader().insert(insertPosition, {
xtype: 'displayfield',
value: 'Who am I? Where? Why am I here?',
height: 22,
ariaRole : 'heading',
noWrap: true,
flex: 1.5
});

maneljn
22 Oct 2012, 6:05 AM
Perfect, Barzoy.