1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Shanghai
    Posts
    71
    Vote Rating
    0
    Answers
    1
    perry_jia is on a distinguished road

      0  

    Default Answered: Ext.dom.Element.mask(msg, msgCls) maybe have a bug

    Answered: Ext.dom.Element.mask(msg, msgCls) maybe have a bug


    I created a Panel contains a toolbar and a component, i just want to mask the "component" after initialized, however it mask the whole Panel and I could not tap the back button on the toolbar because of the mask.


    QQ截图20111121113655.png


    Code:
    Ext.setup({
        onReady : function() {
            var panel = Ext.create('Ext.Panel', {
                fullscreen: true,
                items: [{
                        xtype : 'toolbar',
                        docked: 'top',
                        items : [{
                            text : 'Back',
                            ui : 'back'
                        }]
                    }, {
                        xtype: 'container',
                        items: [{
                            xtype: 'textfield'
                        }, {
                            xtype: 'textfield'
                        }]
                    }
               ],
                   
               initialize: function() {
                     var a2 = this.items.get(1);
                     a2.mask('Loading...', 'x-loading-spinner', true);
               }
            });
        }
    });

  2. It must be a bug.

    .x-mask {
    • position: absolute;
    • top: 0;
    • left: 0;
    • bottom: 0;
    • right: 0;
    • height: 100%;
    • z-index: 10;
    • display: -webkit-box;
    • display: box;
    • -webkit-box-align: center;
    • box-align: center;
    • -webkit-box-pack: center;
    • box-pack: center;
    • background: rgba(0, 0, 0, 0.3) center center no-repeat;
    }

    so the whole panel is masked.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,710
    Vote Rating
    436
    Answers
    3113
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Don't override methods like that. I would listen for an event and mask the component.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Mar 2011
    Location
    Shanghai
    Posts
    71
    Vote Rating
    0
    Answers
    1
    perry_jia is on a distinguished road

      0  

    Default


    Listen for an event?
    Did you mean "initialize" method should not be overrided?
    But which event should i listen for? The "afterrender" is deprecated.

    Can you show me the code?
    Thank you very much.

  5. #4
    Sencha User
    Join Date
    Mar 2011
    Location
    Shanghai
    Posts
    71
    Vote Rating
    0
    Answers
    1
    perry_jia is on a distinguished road

      0  

    Default


    It must be a bug.

    .x-mask {
    • position: absolute;
    • top: 0;
    • left: 0;
    • bottom: 0;
    • right: 0;
    • height: 100%;
    • z-index: 10;
    • display: -webkit-box;
    • display: box;
    • -webkit-box-align: center;
    • box-align: center;
    • -webkit-box-pack: center;
    • box-pack: center;
    • background: rgba(0, 0, 0, 0.3) center center no-repeat;
    }

    so the whole panel is masked.

  6. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    4
    Vote Rating
    0
    alnino is on a distinguished road

      0  

    Red face


    Hi,
    I don't know if you can use this method panel.setMask({xtype:'loadmask', message: 'Please Wait', indicator: true});
    or panel.setMasked({xtype:'loadmask', message: 'Please Wait', indicator: true});