2017-04-05 28 views
0

我是新來的ext js。我的要求是在ext js 6.0.1中的禁用組件上顯示工具提示(例如'按鈕','textfield','datepicker'等xtype)。工具提示禁用組件在ext js 6.0.1

我很感激,如果有人面臨相同的問題,並有相同的解決方案。

+0

ExtJS的允許顯示在禁用的組件尖狀button.You可以使用配置*提示*或在此鏈接中使用setTooltip()方法按鈕: http://docs.sencha.com/extjs/5.0.0/api/Ext.button.Button.html#method-setTooltip – Tejas

回答

1

一種簡單的方式展現在ExtJS的禁用按鍵提示是爲.x-item-disabledpointer-events:none樣式規格改爲pointer-events:all

<style> 
    .x-item-disabled, .x-item-disabled * { 
    pointer-events:all; 
} 
</style> 

見小提琴here

0

對於按鈕 - 添加提示配置。

var button={ 
     xtype : 'button', 
     id : 'BtnId', 
     tooltip:'', 
     text:'' 
}; 

當您禁用按鈕。

button.disable(); 
button.setTooltip("Message"); 
0

你可以做到這一點programmaticly:

var button={ 
    xtype : 'button', 
    tooltip: 'Tooltip', 
    text:'Text', 
    style: { 
     pointerEvents: 'all' 
    } 
}; 

或部件後進行初始化:

button.setStyle({pointerEvents: 'all'});