Results 1 to 4 of 4

Thread: Window mask

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    20

    Default Window mask

    Hi,

    How does one mask and unmask the content area of the window? I've tried window.dom.mask() and several other things but can't figure it out.

    Thanks.

  2. #2
    Ext JS Premium Member gevik's Avatar
    Join Date
    May 2009
    Location
    The Netharlands
    Posts
    277

    Default

    Hi,

    Code:
    /* STEP1 : create a window */
    var win = new Ext.Window({
        width:320,
        height:200,
        title:'test window'
    });
    
    /* STEP2: show the window */
    win.show();
    
    /* STEP 3, method 1 */
    win.el.mask();
    //win.el.unmask();
    
    
    /* STEP 3, method 2 */
    var loadMask = new Ext.LoadMask(win.el,{
        msg:'Please Wait...'
    });
    
    loadMask.show();
    //loadMask.hide();
    If you need to mask the content area only, then use win.body instead of win.el in the code above.
    If you need to mask the entire browser page then use the LoadMask with Ext.getBody().

    Hope this helps.

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2008
    Posts
    20

    Default

    Hi,

    Thanks for the reply. I tried both body.mask and el.mask.

    body.mask produces this error in IE: invalid targete element for this operation.

    using body.el doesn't seem to mask the window.

    My code is like this.
    FVPreviewWin = Ext.extend( Ext.Window, {
    initComponent: function(){
    FVPreviewWin.superclass.initComponent.call(this);
    },
    showFile: function(){
    this.body.mask();
    this.body.dom.src = Ext.BLANK_IMAGE_URL;
    this.setTitle( this.ContentsGrid.selModel.getSelected().data.Name );
    this.getTopToolbar().items.items[4].setText( 'of ' + this.ContentsGrid.selModel.getSelected().data.PI );
    this.getTopToolbar().getComponent('PageNo').setValue( 1 );
    this.getTopToolbar().items.items[8].setValue( this.ContentsGrid.selModel.getSelected().data.Checked );
    this.loadImage();
    this.body.unmask();
    },

    Any suggestions are welcomed.

    Thanks.

  4. #4
    Ext JS Premium Member gevik's Avatar
    Join Date
    May 2009
    Location
    The Netharlands
    Posts
    277

    Default

    The body element of a Window is not created until the window is visible. So, for any masking to work, your window must be visible first.

Posting Permissions

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