3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
20 Ext.onReady(function() {
21 // Generate the buttons
22 var defaultButtonConfig = {
31 text : 'Basic ToolTip',
35 text : 'autoHide disabled',
39 text : 'Ajax ToolTip',
47 text : 'Anchor right, rich content',
51 text : 'Anchor below',
56 text : 'Anchor with tracking',
60 Ext.each(buttons, function(config) {
61 var btn = Ext.create('Ext.Button', Ext.apply({}, config, defaultButtonConfig));
67 html: 'A very simple tooltip'
71 autoLoad: {url: 'ajax-tip.html'},
72 dismissDelay: 15000 // auto hide after 15 seconds
75 title: 'My Tip Title',
76 html: 'Click the X to close me',
84 html: 'This tip will follow the mouse while it is over the element',
87 title: '<a href="#">Rich Content Tooltip</a>',
88 id: 'content-anchor-tip',
89 target: 'leftCallout',
95 contentEl: 'content-tip', // load content from the page
98 this.header.on('click', function(e){
100 Ext.Msg.alert('Link', 'Link to something interesting.');
101 Ext.getCmp('content-anchor-tip').hide();
102 }, this, {delegate:'a'});
106 target: 'bottomCallout',
108 anchorOffset: 85, // center the anchor on the tooltip
109 html: 'This tip\'s anchor is centered'
111 target: 'trackCallout',
114 html: 'Tracking while you move the mouse'
117 Ext.each(tooltips, function(config) {
118 Ext.create('Ext.tip.ToolTip', config);
121 Ext.QuickTips.init();