I have an ExtJs
bo box as following. I am using ExtJS 3.4. I need to set hover text for this bo box. i.e. when user hover over this bo box, message text should appear.
new Ext.form.ComboBox({
store : driverStore,
displayField : 'dName',
valueField : 'dName',
fieldLabel : 'Driver Name',
id : 'driverbo',
allowBlank : false,
typeAhead : true,
forceSelection : true,
mode : 'local',
triggerAction : 'all',
selectOnFocus : true,
editable : false,
hidden : false,
disabled : true,
minChars : 1,
hideLabel : true,
style : 'marginleft:10px',
//width : 147,
emptyText : 'Driver Name',
flex : 1
});
I know there is a way to set this tool tip messages for bo box items of the drop down menu. But I don't want it. I want a tool tip for my bo box.
How should I do that ?
I have an ExtJs
bo box as following. I am using ExtJS 3.4. I need to set hover text for this bo box. i.e. when user hover over this bo box, message text should appear.
new Ext.form.ComboBox({
store : driverStore,
displayField : 'dName',
valueField : 'dName',
fieldLabel : 'Driver Name',
id : 'driverbo',
allowBlank : false,
typeAhead : true,
forceSelection : true,
mode : 'local',
triggerAction : 'all',
selectOnFocus : true,
editable : false,
hidden : false,
disabled : true,
minChars : 1,
hideLabel : true,
style : 'marginleft:10px',
//width : 147,
emptyText : 'Driver Name',
flex : 1
});
I know there is a way to set this tool tip messages for bo box items of the drop down menu. But I don't want it. I want a tool tip for my bo box.
How should I do that ?
Share Improve this question edited Jan 20, 2014 at 7:26 Rose18 asked Jan 20, 2014 at 7:14 Rose18Rose18 3,1628 gold badges51 silver badges100 bronze badges 1- there is no event for hover, no chance! – Oğuz Çelikdemir Commented Jan 20, 2014 at 7:31
2 Answers
Reset to default 12You can create Ext.ToolTip
in listener for bobox
render
event and as tooltip
target you can define bobox element.
var bo = new Ext.form.ComboBox({
mode: 'local',
renderTo: Ext.getBody(),
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'myId',
'displayText'
],
data: [[1, 'item1'], [2, 'item2']]
}),
listeners: {
render: function(c) {
new Ext.ToolTip({
target: c.getEl(),
html: 'Tooltip content'
});
}
},
valueField: 'myId',
displayField: 'displayText'
});
Fiddle with example: https://fiddle.sencha./#fiddle/2q6
Put this in the Listener of bo box it worked at my side.
Ext.onReady(function() {
Ext.QuickTips.init();
var bo = new Ext.form.ComboBox({
mode: 'local',
renderTo: Ext.getBody(),
store: new Ext.data.ArrayStore({
id: 0,
fields: ['id', 'displaytext'],
data: [
[1, 'Vinayak']
]
}),
listeners: {
render: function(c) {
Ext.QuickTips.register({ target: this.getEl(),
text: 'Tooltip Data' });
}
},
valueField: 'id',
displayField: 'displaytext'
});
});
You have to write
Ext.QuickTips.init()
; on Ext.Ready