Results 1 to 2 of 2

Thread: Enable and disable extjs tooltip from toolbar items

  1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    3

    Lightbulb Enable and disable extjs tooltip from toolbar items

    n my toolbar there is checkbox used for enabling and disabling tooltip.If the checkbox is checked then i should enable tooltip and it is working if not then i should disable it also working. after disabling tooltip when click on toolbar not on any item in the toolbar then also it is enabling toogleTooltip is a handler of checkbox
    Code:
    function toggleTooltip() { 
    debugger; 
    if(Ext.getCmp("msai_tool_tip").checked) { 
      Ext.QuickTips.enable();
       while(!Ext.QuickTips.isEnabled())  
       Ext.QuickTips.enable();
     } 
     else  {
         Ext.QuickTips.disable();
         while(Ext.QuickTips.isEnabled())  
           Ext.QuickTips.disable(); }
     }
    this is my toolbar creation code
    Code:
    Ext.QuickTips.init();
     var tb = new Ext.Toolbar({
     id:'form_menu_bar', 
    renderTo: Ext.get('newproducttitle').dom, 
    items: [     
    {         
    tooltip:        
     {         text: "Click on this button to generate the template and save it in server.", 
            title: "Save" , 
            xtype: "quicktip"   
      }         ,
    iconCls : 'msai_save_template'         ,
     handler : generateTemplate      
     },   
     {        
     tooltip:         
    {         
    text: "Click on this button to generate the template.", 
            title: "Save to clipboard" ,
             xtype: "quicktip"         
     }        
     , iconCls : 'msai_save_clipboard'        
     , handler : generateTemplateClipboard     
    
     }]});
    please suggest some solution so that i should not show tooltip if user click on toolbar not in any item

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791

    Default

    You haven't included the code for the creation of the checkbox itself, which makes guessing what the problem is a little harder. I'd speculate that when you click on the toolbar what you're actually doing is clicking on the label element associated with the checkbox. Try adding boxLabel: '' to your checkbox config to stop that element being created.

    Also, the while loops in toggleTooltip() seem completely unnecessary.

Tags for this Thread

Posting Permissions

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