Results 1 to 4 of 4

Thread: Can I put a tooltip on a field label of a form

  1. #1
    Ext JS Premium Member
    Join Date
    Nov 2010
    Posts
    52

    Default Can I put a tooltip on a field label of a form

    I have a form, I have a field defined as

    Code:
    {	        fieldLabel: 'Risk',
    		name: 'risk',
    	        anchor:'96%',
    		labelAlign: 'left',
    		xtype: 'textfield'								
               }
    I want to have a tooltip for Risk, when the cursor goes there, it should show some information to explain the definition of the Risk. How can I do it?
    I know we can do it on button, how can I add a button next to the label?

    Any help is appreciated!

  2. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    22

    Default

    You may find this useful:

    http://stackoverflow.com/questions/5838646/how-should-i-add-a-tooltip-to-an-extjs-component

    The QuickTip will be added to the field. So mousing over the field itself (not the label) will show the extra information.


    { fieldLabel: 'Last Name', qtip: "This is a tip", name: 'last', listeners: { render: function(c) { Ext.QuickTips.register({ target: c.getEl(), text: c.qtip }); } } }

  3. #3
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    3

    Default

    @andrevio If you only want a tooltip mousing over the label use c.labelEl and not c.getEl() { fieldLabel: 'Last Name', qtip: "This is a tip", name: 'last', listeners: { render: function(c) { Ext.QuickTips.register({ target: c.labelEl, text: c.qtip }); } } }

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    22

    Default

    Thank you for the tip, A. Linders, that works.

    Quote Originally Posted by A. Linders View Post
    @andrevio If you only want a tooltip mousing over the label use c.labelEl and not c.getEl() { fieldLabel: 'Last Name', qtip: "This is a tip", name: 'last', listeners: { render: function(c) { Ext.QuickTips.register({ target: c.labelEl, text: c.qtip }); } } }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •