Results 1 to 2 of 2

Thread: Adding a close button to a window

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    50
    Answers
    2

    Default Adding a close button to a window

    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?

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,751
    Answers
    130

    Default

    take a look at:
    http://docs.sencha.com/extjs/4.2.2/s...xt-panel-Panel

    initTools

    Code:
    //...
            // 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.
    Best regards
    Tobias Uhlig

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •