PDA

View Full Version : Hi all, My requirement is to apply tooltip to the ComboBox on the hover of the mouse



Vijaya436
29 Sep 2009, 11:25 AM
And this is my Code I tried..

function prepareAverageWorkExpCombo(emptyValueText) {
var averageWorkExpStore = new Ext.data.SimpleStore( {
fields : [ 'workExp' ],
data : Ext.data.workExp
});
var averageWorkExpCombo = new Ext.form.ComboBox( {
store : averageWorkExpStore,
displayField : 'workExp',
typeAhead : true,
id : 'averageWorkExperiance',
hideLabel : true,
mode : 'local',
triggerAction : 'all',
emptyText : 'Any',
selectOnFocus : true,
resizable : true,
width:100,
listeners : {
'change' : comboBoxListener
}
});

var tt = new Ext.ToolTip({
target: 'track-tip',
title: 'Mouse Track',
width:200,
html: 'This tip will follow the mouse while it is over the element',
trackMouse:true
});
return averageWorkExpCombo;
}

Where am I going wrong. Any small help wil be of great help.
Thanks in Advance

dlbjr
29 Sep 2009, 11:53 AM
var averageWorkExpCombo = new Ext.form.ComboBox({
store: averageWorkExpStore,
displayField: 'workExp',
typeAhead: true,
hideLabel: true,
mode: 'local',
triggerAction: 'all',
emptyText: 'Any',
selectOnFocus: true,
resizable: true,
width: 100,
listeners: {
'change': comboBoxListener
}
});


var tt = new Ext.ToolTip({
target: averageWorkExpCombo,
title: 'Mouse Track',
width: 200,
html: 'This tip will follow the mouse while it is over the element',
trackMouse: true
});

Vijaya436
29 Sep 2009, 10:28 PM
Thnks for ur help dlbjr.. I tried that but I am getting the error at
"target:averageWorkExpCombo" as "this.target is null or not an Object".
Should I add some .js file??? I added ToolTip.js and tried.

dlbjr
30 Sep 2009, 3:59 AM
The target will be what ever variable you make the Combo box as.

syedarshadali
21 Jan 2010, 9:35 PM
Thnks for ur help dlbjr.. I tried that but I am getting the error at
"target:averageWorkExpCombo" as "this.target is null or not an Object".
Should I add some .js file??? I added ToolTip.js and tried.


Just try that:



var tt = new Ext.ToolTip({
target: averageWorkExpCombo.geEl(),
title: 'Mouse Track',
width: 200,
html: 'This tip will follow the mouse while it is over the element',
trackMouse: true
});