PDA

View Full Version : how to add tooltips on window close button and collapse button



hwang0
9 May 2013, 9:58 AM
I can add tooltip on any custom buttons, but I can not find configuration in documentation for default ones like close button and collapse.

friend
9 May 2013, 10:43 AM
Disclaimer: This feels pretty kludgy to me and there's probably a cleaner way to do this. Regardless, this works:



var x = Ext.create('Ext.window.Window', {
height: 100,
minimizable: true,
width: 200
}).show();

Ext.create('Ext.tip.ToolTip', {
target: x.header.items.get(1).el,
html: 'Click to minimize window.'
});

Ext.create('Ext.tip.ToolTip', {
target: x.header.items.get(2).el,
html: 'Click to close window.'
});

hwang0
9 May 2013, 11:23 AM
Thanks, that works.


Disclaimer: This feels pretty kludgy to me and there's probably a cleaner way to do this. Regardless, this works:



var x = Ext.create('Ext.window.Window', {
height: 100,
minimizable: true,
width: 200
}).show();

Ext.create('Ext.tip.ToolTip', {
target: x.header.items.get(1).el,
html: 'Click to minimize window.'
});

Ext.create('Ext.tip.ToolTip', {
target: x.header.items.get(2).el,
html: 'Click to close window.'
});