Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    Apr 2007
    Posts
    16
    Vote Rating
    0
    michael.prichard is on a distinguished road

      0  

    Default Menu not showing tooltips....

    Menu not showing tooltips....


    Here is my code:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Toolbar with Menu</title>
    
    <link rel="stylesheet" type="text/css" href="assets/ext-1.0/resources/css/ext-all.css" />
    <!-- LIBS -->     
    <script type="text/javascript" src="assets/ext-1.0/adapter/yui/yui-utilities.js"></script>     
    <script type="text/javascript" src="assets/ext-1.0/adapter/yui/ext-yui-adapter.js"></script>     
    <!-- ENDLIBS -->
    <script type="text/javascript" src="assets/ext-1.0/ext-all.js"></script>
    
    <script type="text/javascript" >
    	
    
    Ext.onReady(function(){
    	
    	var toolsMenu = new Ext.menu.Menu({
    		id: 'myMenu',
    		items: [
                  {text: '<b>Bold</b>', handler: onItemClick, tooltip:'tip this!'},
                  {text: 'Groups', handler: onItemClick},
                  {text: '<i>Italic</i>', handler: onItemClick}
    		]
    	});
    	
    	var tb = new Ext.Toolbar('toolbar');
    	tb.add(
    		new Ext.Toolbar.Button({
    			text:'Search',
    			handler: onButtonClick
    		}),
    		{
    		text:'Tools',
    		menu: toolsMenu  // assign menu by instance
    	    },
    		new Ext.Toolbar.Button({
    			text:'Help',
    			handler: onButtonClick,
    			tooltip: {text:'This is a QuickTip with autoHide set to false and a title'}
    		}),
    			new Ext.Toolbar.Button({
    			text:'Logout',
    			handler: onButtonClick,
    			tooltip: 'Logout from Application',
    			
    			enableToggle: true
    	})
    		
    	);
    	
    	// handlers
        // functions to display feedback
        function onButtonClick(btn){
            Ext.Msg.alert('Button Click','You clicked the ' + btn.text + ' button.', btn.text);
        }
    
        function onItemClick(item){
            Ext.example.msg('Menu Click', 'You clicked the "{0}" menu item.', item.text);
        }
    
    });
    </script>
    
    </head>
    <html>
    <body>
    
    <div id="container">
    <div id="toolbar" >	
    </div>
    </div>
    
    </body>
    </html>
    I can't get any of the tooltips to show. Any ideas?

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    3
    tryanDLS is on a distinguished road

      0  

    Default


    Add this to the top of your function
    Code:
    Ext.QuickTips.init();

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Bah
    Posts
    434
    Vote Rating
    0
    efege is on a distinguished road

      0  

    Default


    I'm using

    Code:
    Ext.QuickTips.init();
    and tooltips are showing on toolbar buttons, but still they don't show on menu items. What syntax should I use?

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    3
    tryanDLS is on a distinguished road

      0  

    Default


    There is no built-in support for tooltips on menu items, but you could so something like
    Code:
    Ext.menu.BaseItem.prototype.onRender = function(container){
      this.el = Ext.get(this.el);
      container.dom.appendChild(this.el.dom);
      if (this.tooltip) {
       this.el.dom.qtip = this.tooltip;
      }
    };
    Then add tooltip:'my Tip' to a menu item's config

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Location
    Bah
    Posts
    434
    Vote Rating
    0
    efege is on a distinguished road

      0  

    Default


    Thanks tryanDLS! Now my menus have tooltips

    And at the same time, I learnt an extra bit about using Ext.

  6. #6
    Ext User
    Join Date
    Apr 2007
    Posts
    16
    Vote Rating
    0
    michael.prichard is on a distinguished road

      0  

    Question


    Great! It worked! Thanks.

    Question, can I build these menus like Yahoo UI? I.e. <div> tags and then do a .render()?

  7. #7
    Sencha User
    Join Date
    Mar 2007
    Posts
    210
    Vote Rating
    1
    KRavEN is on a distinguished road

      0  

    Default


    How would you go about doing the same for form fields?

  8. #8
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    3
    tryanDLS is on a distinguished road

      0  

    Default


    The flow for fields is a little different, but you could probably do the same thing by overriding Field.prototype.onRender. Or it might be better to override afterRender - it's less code to add to your override file. Another way to avoid overriding base code would be to add the logic to the focus event handler and make sure you only add the tip the 1st time thru.

  9. #9
    Ext JS - Development Team J.C. Bize's Avatar
    Join Date
    May 2007
    Location
    Bay Area, CA
    Posts
    179
    Vote Rating
    0
    J.C. Bize is on a distinguished road

      0  

    Default QuickTips on Form Fields

    QuickTips on Form Fields


    Quote Originally Posted by tryanDLS View Post
    The flow for fields is a little different, but you could probably do the same thing by overriding Field.prototype.onRender. Or it might be better to override afterRender - it's less code to add to your override file. Another way to avoid overriding base code would be to add the logic to the focus event handler and make sure you only add the tip the 1st time thru.
    Yeah this works great... just what I was looking for, thanks.

    PHP Code:
    //override onRender function for form fields so that they display QuickTips
    Ext.form.Field.prototype.afterRender = function(){
        if (
    this.tooltip) {
            
    this.el.dom.qtip this.tooltip;
        }
        
    Ext.form.Field.superclass.afterRender.call(this);
        
    this.initEvents();
    };

    ...

    var 
    combo = new Ext.form.ComboBox({
        
    storestore,
        
    displayField:'state',
        
    typeAheadtrue,
        
    mode'local',
        
    triggerAction'all',
        
    emptyText:'Select a state...',
        
    selectOnFocus:true,
        
    width:135,
        
    tooltip'<b>State</b><br/>Name of the state to display'
    }); 
    Hopefully, someone else will find this helpful!

    Regards,
    JC

  10. #10
    Ext User
    Join Date
    Aug 2007
    Posts
    60
    Vote Rating
    0
    mscdex is on a distinguished road

      0  

    Default


    Sorry, I found out there was a problem elsewhere in my code and had nothing to do with the snippet, after fixing that that snippet works great! Thanks
    Last edited by mscdex; 22 Aug 2007 at 12:32 PM. Reason: Found the error