Ext.LoadMask允许编辑TextField。怎么避免呢?

时间:2015-03-12 01:36:27

标签: extjs focus textfield loadmask

应用LoadMask后,textfield仍然可以编辑(虽然已屏蔽)。

Screensot

Code snippet in 3.4.0

var enterPressedCounter=0; var btn = new Ext.Button({
     text: 'Unmask it',
     handler: function(){
         if(form.mask) form.mask.hide();
     } }); 

var textField= new Ext.form.TextField({
    fieldLabel: 'Text field',
    emptyText: 'Please enter a text and press enter',
    width: 230,
    listeners: {
        specialkey: function(field, e){
            if (e.getKey() == e.ENTER) {
                enterPressedCounter++;
                if(enterPressedCounter % 2 == 1){
                    form.mask= new Ext.LoadMask(form.el,{ msg:
                        'Now continue typing...'});
                    form.mask.show();
                }else{
                    btn.handler();
                }
            }
        }
    }
});

var form = new Ext.FormPanel({        
    frame:true,
    title: 'Load mask with text',
    bodyStyle:'padding:5px 5px 0',
    width: 500,     height: 150,        
    items: textField,
    mask: null,
    buttons: [btn] 
 });

form.render(document.body);

如何在没有副作用的情况下解决此问题?

另见:

0 个答案:

没有答案