Results 1 to 6 of 6

Thread: ? Possible: Tooltip for text field on toolbar

  1. #1

    Question ? Possible: Tooltip for text field on toolbar

    Does QuickTips work for text fields on toolbars or can a tooltip for these fields be specified some other way?

    The following does not work:
    {
    xtype: 'textfield',
    id: 'FilterValue',
    fieldLabel: 'Search',
    tooltip: 'Use % to match any characters
    '}

    although it works for a toolbar button.

    Thanks for any tips,

    Tim

  2. #2

    Default

    Couldn't find the 'tooltip' config option in the [URL=

  3. #3

    Smile Eventually discovered the solution

    Unfortunately msgTarget is only of relevance when returning errors to form fields, but it does not matter as I discovered a thread which said that you add a listener (as below) to the config object of the text field you magically get a tooltip:
    Code:
    listeners: {render: function(c) {
    				      Ext.QuickTips.register({
    				        target: c.getEl(),
    				        text: 'The tooltip text'
    				      });
    				    }
    	      }
    And it works!

  4. #4

    Default

    Hm, didn't know that. Good work and thanks for sharing!

  5. #5
    Ext User franck34's Avatar
    Join Date
    Dec 2007
    Location
    France, Montpellier
    Posts
    148

    Default

    Personaly, i'm using this:

    Code:
    myForm.on('show',function() {
        for (var i=0;i<myForm.form.items.items.length;i++) {
            var myField=myForm.form.items.items[i];
            if (myField.tooltip) {
                Ext.QuickTips.register({
                    target: myField.getEl(),
                    text: myField.tooltip
                });
            }
        }
    });
    So i can add the tooltip attribute on any fields in my form, to avoid duplicate QuickTips register lines and win some bytes.

    Usage Example:

    Code:
    {
        fieldLabel:'myFieldLabel',
        xtype:'datefield',
        tooltip:'Here is my tooltip'
    }

  6. #6
    Ext User rrochap's Avatar
    Join Date
    May 2008
    Location
    Barranquilla,Colombia
    Posts
    20

    Default Thnk

    I works but with out the event form on show

    for (var i=0;i<myForm.form.items.items.length;i++) {
    var myField=myForm.form.items.items[i];
    if (myField.tooltip) {
    Ext.QuickTips.register({
    target: myField.getEl(),
    text: myField.tooltip
    });
    }
    }

Posting Permissions

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