Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs4显示禁用按钮的工具提示_Extjs_Extjs4 - Fatal编程技术网

Extjs4显示禁用按钮的工具提示

Extjs4显示禁用按钮的工具提示,extjs,extjs4,Extjs,Extjs4,当我禁用按钮时,它的工具提示也会禁用。即使按钮被禁用,也有办法显示工具提示 //create my button var myButton = Ext.create('Ext.Button', { tooltip : 'my Button Tooltip Text', id : 'my-button ', iconCls : 'star-icon', handler: Ext.Func

当我禁用按钮时,它的工具提示也会禁用。即使按钮被禁用,也有办法显示工具提示

//create my button
       var myButton = Ext.create('Ext.Button', {
            tooltip :  'my Button Tooltip Text',
            id : 'my-button ',
            iconCls : 'star-icon',
            handler: Ext.Function.pass(_rmp.mediaManager.myButtonFunction, this)
        });

 //disable my button
    Ext.getCmp('my-button').disable();
编辑: 在firefox(我使用的是8.0.1版)上,其他浏览器(chrome、safari、opera)的工具提示没有达到预期效果。

@jeewiya

默认情况下,ExtJS框架在禁用按钮上显示工具提示。以下是我的重置按钮上的内容:

{
        text: 'Reset',
        tooltip :  'my Button Tooltip Text',
            id : 'my-button ',
        handler: function() {
            this.up('form').getForm().reset();
        }
}
下图显示,即使在禁用重置按钮后,提示仍会出现

如果您想试用我的示例,下面是我用ExtJS 4.0.7测试的完整代码,它按预期工作:

Ext.onReady(function(){

Ext.tip.QuickTipManager.init();

var form = Ext.create('Ext.form.Panel', {

    renderTo: Ext.getBody(),

    title: 'Simple Form',
    bodyPadding: 5,
    width: 350,

    layout: 'anchor',
    defaults: {
        anchor: '100%'
    },

    // The fields
    defaultType: 'textfield',
    items: [{
        fieldLabel: 'First Name',
        name: 'first',
        allowBlank: false
    },{
        fieldLabel: 'Last Name',
        name: 'last',
        allowBlank: false
    }],

    // Reset and Submit buttons
    buttons: [{
        text: 'Reset',
        tooltip :  'my Button Tooltip Text',
        id : 'my-button ',
        handler: function() {
            this.up('form').getForm().reset();
        }
    }, {
        text: 'Submit',
        formBind: true, 
        disabled: true,
        handler: function() {
            Ext.getCmp('my-button ').disable();
        }
    }],
    renderTo: Ext.getBody()
});



});

嗨,谢谢你的帮助。但是我还是不能解决这个问题。我使用您的代码创建了一个JSFIDLE,但它在firefox(我使用的是8.0.1版)上无法正常工作,其他浏览器(chrome、safari、opera)的工具提示也无法正常工作。我还测试了我的代码,发现它不仅在firefox上有效,这是firefox中的一个bug——目标里程碑被称为mozilla8,所以我们预计它随时都会出现。