0
votes

I have a dynamic form in extjs and i want to add tooltip to some elements of the form.

 widget = {
                    width: 100,
                    title: name,
                    margin: '0 0 0 0',
                    id: id
                }

that my widget that i want to add tooltip.

I have already tried adding listener to widget but it didnt work

listeners: {
    render: function(c) {
        Ext.create('Ext.tip.ToolTip', {
            target: c.getEl(),
            html: c.tip
        });
    }
}

thats what i have already tried.

thanks in advance.

1

1 Answers

0
votes
            listeners : {
                        render: function(p) {
                             var theElem = p.getEl();
                             var theTip = Ext.create('Ext.tip.Tip', {
                                 html: name,
                                 margin: '0 0 0 200',
                                 shadow: false
                             });

                             p.getEl().on('mouseover', function(){
                                 theTip.showAt(theElem.getX(), theElem.getY());
                             });

                             p.getEl().on('mouseleave', function(){
                                 theTip.hide();
                             });
                         }
                     }

I found the solution, adding this listener help me to add tooltip