1. #1
    Sencha User
    Join Date
    Nov 2007
    Location
    Lille, France
    Posts
    40
    Vote Rating
    0
    disizben is on a distinguished road

      0  

    Default TriggerField tooltips

    TriggerField tooltips


    Hello !

    I did not find any config option to add some tooltips over the TriggerField's triggers

    So I had to override the getTriggerMarkup function as follows :

    Code:
    Ext.define('Ext.override.form.field.Trigger', {
        override: 'Ext.form.field.Trigger',
    
        getTriggerMarkup: function() {
            var me = this,
                i = 0,
                hideTrigger = (me.readOnly || me.hideTrigger),
                triggerCls,
                triggerTip,
                triggerBaseCls = me.triggerBaseCls,
                triggerConfigs = [];
    
            // TODO this trigger<n>Cls API design doesn't feel clean, especially where it butts up against the
            // single triggerCls config. Should rethink this, perhaps something more structured like a list of
            // trigger config objects that hold cls, handler, etc.
            // triggerCls is a synonym for trigger1Cls, so copy it.
            if (!me.trigger1Cls) {
                me.trigger1Cls = me.triggerCls;
            }
    
            if (!me.trigger1Tip) {
                me.trigger1Tip = me.triggerTip;
            }
    
            // Create as many trigger elements as we have trigger<n>Cls configs, but always at least one
            for (i = 0; (triggerCls = me['trigger' + (i + 1) + 'Cls']) || i < 1; i++) {
    
                triggerTip = me['trigger' + (i + 1) + 'Tip'];
    
                triggerConfigs.push({
                    tag: 'td',
                    valign: 'top',
                    cls: Ext.baseCSSPrefix + 'trigger-cell',
                    style: 'width:' + me.triggerWidth + (hideTrigger ? 'px;display:none' : 'px'),
                    cn: {
                        cls: [Ext.baseCSSPrefix + 'trigger-index-' + i, triggerBaseCls, triggerCls].join(' '),
                        'data-qtip': triggerTip,
                        role: 'button'
                    }
                });
            }
            triggerConfigs[i - 1].cn.cls += ' ' + triggerBaseCls + '-last';
    
            return Ext.DomHelper.markup(triggerConfigs);
        }
    });
    Is it possible to add those triggernTip config options in the next Ext 4.1 release ?

    Thanks !

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,001
    Vote Rating
    456
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thank you for the suggestion. I will pass this along.

    Regards,
    Scott.

Thread Participants: 1