PDA

View Full Version : Adding a close button to a window



iamcootis
23 Jan 2014, 6:44 AM
I have a window and on the first time I show it, I don't want it to have a close button which forces the user to make a selection.

After the user makes a selection, I hide the window.

On subsequent opens of the window I want there to be a close button. How can I make this happen? I have tried to add this.getWindow().setCloseable(true), but that isn't working. Is there some other way I should be doing this?

tobiu
23 Jan 2014, 8:27 AM
take a look at:
http://docs.sencha.com/extjs/4.2.2/source/Panel6.html#Ext-panel-Panel

initTools



//...
// Make Panel closable.
if (me.closable) {
me.addClsWithUI('closable');
me.addTool(Ext.widget({
xtype : 'tool',
type: 'close',
handler: Ext.Function.bind(me.close, me, [])
}));
}


you should be able to add the tool dynamically.