0

I want to close a Window when clicking outside the Window, I think I need something like a click-handler on the mask behind the window (yes its modal=true) or a "onLooseFocus"-Handler on the Window... I tried this:

windowX.Listeners.Show.Handler = "Ext.select('.ext-el-mask').addListener('click', function() {Ext.getCmp('windowX').hide();});";

But it doesn't work, also no error in Firebug so i cant find the mistake - can anyone help me?

edit: I'm using Ext.Net 2.2

MMMagic
  • 182
  • 2
  • 14

1 Answers1

0

I found this on the ext.net forums

    <ext:Window runat="server" Modal="true">
    <Listeners>
        <Show Handler="this.mask.on('click', function () {
                            alert('I am the Mask!');
                        });"
                Single="true" />
    </Listeners>
    </ext:Window>

Edit

Since its not working, returning to extjs is the best solution, with help from this answer the code becomes

    <ext:Window runat="server" Modal="true">
    <Listeners>
        <Show Handler="this.mon(Ext.getBody(), 'click', function (el, e) {
            this.close(this.closeAction);
        }, this, { delegate: '.x-mask' });"
                Single="true" />
    </Listeners>
    </ext:Window>
Community
  • 1
  • 1
Mahmoud Darwish
  • 1,168
  • 1
  • 15
  • 28
  • they must have changed this, doesn't work. Sorry I didn't mention my Ext.Net Version - it is 2.2 – MMMagic Jul 10 '13 at 14:48