1. #1
    Ext User
    Join Date
    Oct 2008
    Posts
    117
    Vote Rating
    0
    lalit_ce is on a distinguished road

      0  

    Question how to show button tooltip

    how to show button tooltip


    Hi,
    experts

    i have one formpanel which have buttons.

    i retrieve button text using
    PHP Code:
     Ext.getCmp('button1').getEl().dom.innerHTML response.data.button1
    from backend response. its running ok.

    now i also want to display tooltip, which same come from backend then how can i do that???

    thanks for help

  2. #2
    Sencha User
    Join Date
    Dec 2008
    Posts
    46
    Vote Rating
    0
    lassaad is on a distinguished road

      0  

    Default


    new Ext.Button({
    text:'Ajouter'
    ,plugins:new Ext.ux.plugin.triggerfieldTooltip()
    ,tooltip: {
    text: "Ajout de nouvelles grilles d'intĂ©rĂȘts"
    }
    ,handler:ajouter
    })

    Code:
    Ext.namespace('Ext.ux.plugin');
    
    Ext.ux.plugin.triggerfieldTooltip = function(config){
        Ext.apply(this, config);
    };
    
    Ext.extend(Ext.ux.plugin.triggerfieldTooltip, Ext.util.Observable,{
        init: function(component){
            this.component = component;
            this.component.on('render', this.onRender, this);
        },
        
        //private
        onRender: function(){
            if(this.component.tooltip){
                if(typeof this.component.tooltip == 'object'){
                    Ext.QuickTips.register(Ext.apply({
                          target: this.component.trigger
                    }, this.component.tooltip));
                } else {
                    this.component.trigger.dom[this.component.tooltipType] = this.component.tooltip;
                }
            }
        }
    });
    Best regards,
    Lassaad

  3. #3
    Ext User
    Join Date
    Oct 2008
    Posts
    117
    Vote Rating
    0
    lalit_ce is on a distinguished road

      0  

    Question thanks for help

    thanks for help


    thank you for help
    but i need to show tooltip from database

    means i display button text using
    PHP Code:
     Ext.getCmp('button1').getEl().dom.innerHTML response.data.button1
    is it any way to do as above or any other way.??

    thank you for help

  4. #4
    Ext User
    Join Date
    Oct 2008
    Posts
    117
    Vote Rating
    0
    lalit_ce is on a distinguished road

      0  

    Smile hi get some hints for this issue

    hi get some hints for this issue


    hi

    PHP Code:
    Ext.getCmp('button1').getEl().dom.title=response.data.button1
    here i can get tooltip but not like extjs tooltip.

    so please if any ideas for that then it appreciated.

    thanks for help

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Upgrade to Ext 3, and you could use http://extjs.com/deploy/ext-3.0-rc2/...ber=setTooltip

Thread Participants: 2