ExtJS 4: Is there any way to attach a QuickTip to a form field?

cansadadeserfeliz picture cansadadeserfeliz · Aug 14, 2013 · Viewed 15.3k times · Source

I'm trying to add a QuickTip to a form field, but can't find a way to make my code work. Firstly, I tried to use a qtip attribute

    {
        fieldLabel: 'Last Name',
        qtip:'This tip is not showing at all',
        name: 'last'
    }

and then using Ext.tip.ToolTip class:

Ext.create('Ext.tip.ToolTip', {
    target: 'rating_field',
    anchor: 'right',
    trackMouse: true,
    html: 'This tip is not showing at all'
});

Ext.QuickTips.init();

Here is a jsfiddle with the source code: jsfiddle

Answer

Reimius picture Reimius · Aug 15, 2013

Yes, use the inputAttrTpl config and the data-qtip attribute:

{
    fieldLabel: 'Last Name',
    inputAttrTpl: " data-qtip='This is my quick tip!' ",
    name: 'last'
}