wm003
16 Apr 2008, 1:35 AM
If you want to have Tooltips on the triggerbuttons of Triggerfields (Combobox,Datefield,...)
i have created a little plugin that makes it possible:
Ext.namespace('Ext.ux.plugin');
Ext.ux.plugin.triggerfieldTooltip = function(config){
Ext.apply(this, config);
};
Ext.extend(Ext.ux.plugin.triggerfieldTooltip, Ext.util.Observable,{
init: function(component){
this.component = component;
this.component.on('render', this.onRender, this);
},
//private
onRender: function(){
if(this.component.tooltip){
if(typeof this.component.tooltip == 'object'){
Ext.QuickTips.register(Ext.apply({
target: this.component.trigger
}, this.component.tooltip));
} else {
this.component.trigger.dom[this.component.tooltipType] = this.component.tooltip;
}
}
}
});
Just add
plugins:new Ext.ux.plugin.triggerfieldTooltip(),
tooltip: {
title:'This is the Triggerbutton',
text: 'If you click here, something happens with the formfield...'
},
to your existing Comboboxes and you have a tooltip/quicktip functionality.
Remember it only fires when hovering over the triggerButton, not the Field itself as this supports tooltips for validation messages (and this is ofcourse still possible)
i have created a little plugin that makes it possible:
Ext.namespace('Ext.ux.plugin');
Ext.ux.plugin.triggerfieldTooltip = function(config){
Ext.apply(this, config);
};
Ext.extend(Ext.ux.plugin.triggerfieldTooltip, Ext.util.Observable,{
init: function(component){
this.component = component;
this.component.on('render', this.onRender, this);
},
//private
onRender: function(){
if(this.component.tooltip){
if(typeof this.component.tooltip == 'object'){
Ext.QuickTips.register(Ext.apply({
target: this.component.trigger
}, this.component.tooltip));
} else {
this.component.trigger.dom[this.component.tooltipType] = this.component.tooltip;
}
}
}
});
Just add
plugins:new Ext.ux.plugin.triggerfieldTooltip(),
tooltip: {
title:'This is the Triggerbutton',
text: 'If you click here, something happens with the formfield...'
},
to your existing Comboboxes and you have a tooltip/quicktip functionality.
Remember it only fires when hovering over the triggerButton, not the Field itself as this supports tooltips for validation messages (and this is ofcourse still possible)