PDA

View Full Version : tooltip on a combo box?



scaddenp
29 Mar 2011, 7:29 PM
Saki's examples show this code for putting a tooltip on a combobox

listeners:{
render:function() {
this.el.set(
{qtip:'Select the active layer for search and query'}
);
this.validate();
}

Works on his page, but I get nothing?? I see the qtip in the html element when I examine the element, but nothing comes up?

tvanzoelen
29 Mar 2011, 11:15 PM
You can also set tooltips with



Ext.QuickTips.register({ target: component.getEl(), text: ´yourtext´ });

It works...

laurentParis
29 Mar 2011, 11:36 PM
you have an answer on example code....
http://dev.sencha.com/deploy/dev/examples/form/combos.html

scaddenp
31 Mar 2011, 3:03 PM
Nope.
combo = new Ext.form.ComboBox({
store: layerStore,
displayField: 'layerName',
valueField: 'layerID',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
title:'Active Layer',
selectOnFocus: true,
editable: false,
width: 120
});
Ext.QuickTips.register({ target: combo.getEl(), text: 'Choose the active layer for search and query' });

No tooltip by this method.

scaddenp
31 Mar 2011, 3:07 PM
you have an answer on example code....
http://dev.sencha.com/deploy/dev/examples/form/combos.html

No. This puts tooltip on each choice, but not a tooltip for just the box itself.

tontorin
10 May 2011, 10:02 PM
Hi, scaddenp.


Nope.
combo = new Ext.form.ComboBox({
store: layerStore,
displayField: 'layerName',
valueField: 'layerID',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
title:'Active Layer',
selectOnFocus: true,
editable: false,
width: 120
});
Ext.QuickTips.register({ target: combo.getEl(), text: 'Choose the active layer for search and query' });

No tooltip by this method.

you should Ext.QuickTips.register after combo rendered.
so,



Ext.QuickTips.register({ target: combo.getEl(), text: 'Choose the active layer for search and query' });

to


combo.on('afterrender', function(){
Ext.QuickTips.register({ target: combo.getEl(), text: 'Choose the active layer for search and query' });
});

scaddenp
11 May 2011, 3:49 PM
Thanks! That works well.