Results 1 to 2 of 2

Thread: modal and system modal dialogs

  1. #1
    Touch Premium Member
    Join Date
    Mar 2008
    Location
    Morgan Hill, CA
    Posts
    138

    Default modal and system modal dialogs

    As I recall from my Windows programing days ( many moons ago ) there were two types of modal dialogs. System modal disallowed any clicks on the entire application. The other kind allowed you to specify the parent object for the dialog and only the parent was masked and had it's clicks disabled.

    I would like a similar functionality in ExtJS. As far as I can tell this does not exist.

    Does anyone know if this is possible?

    If not, it seems like a useful feature.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    You may be able to do something like:

    Code:
    Ext.onReady(function(){
    
        var parentWin = Ext.create('Ext.window.Window', {
            id: 'parentwin', // dirty access to window for example
            title: 'Parent',
            height: 200,
            width: 400,
            items: [{
                xtype: 'textfield',
                fieldLabel: 'My Text'
            }]
        }).show();
    
        var childWin = Ext.create('Ext.window.Window', {
            id: 'childwin',
            title: 'Child',
            height: 100,
            width: 200,
            listeners: {
                show: function() {
                    var pw = Ext.getCmp('parentwin');
                    pw.getEl().mask();
                    pw.disable();
                },
                close: function() {
                    var pw = Ext.getCmp('parentwin');
                    pw.enable();
                    pw.getEl().unmask();
                }
            }    
        }).show(); 
    
    });
    You would also need to access the Ext.WindowManager to decide if the parent window could be brought to the front since you can select it to simulate modal.

    Regards,
    Scott.

Tags for this Thread

Posting Permissions

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