-
20 Nov 2011 9:21 AM #1
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); } }); } });
-
Best Answer Posted by perry_jia
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.
-
20 Nov 2011 12:59 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
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.
-
20 Nov 2011 7:19 PM #3
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.
-
20 Nov 2011 8:19 PM #4
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.
-
20 Feb 2012 11:03 PM #5
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});


Reply With Quote