1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-tip.Tip-method-constructor'><span id='Ext-tip.Tip'>/**
2 </span></span> * @class Ext.tip.Tip
3 * @extends Ext.panel.Panel
4 * This is the base class for {@link Ext.tip.QuickTip} and {@link Ext.tip.ToolTip} that provides the basic layout and
5 * positioning that all tip-based classes require. This class can be used directly for simple, statically-positioned
6 * tips that are displayed programmatically, or it can be extended to provide custom tip implementations.
9 * @param {Object} config The configuration options
12 Ext.define('Ext.tip.Tip', {
13 extend: 'Ext.panel.Panel',
14 requires: [ 'Ext.layout.component.Tip' ],
15 alternateClassName: 'Ext.Tip',
16 <span id='Ext-tip.Tip-cfg-closable'> /**
17 </span> * @cfg {Boolean} closable True to render a close tool button into the tooltip header (defaults to false).
19 <span id='Ext-tip.Tip-cfg-width'> /**
20 </span> * @cfg {Number} width
21 * Width in pixels of the tip (defaults to auto). Width will be ignored if it exceeds the bounds of
22 * {@link #minWidth} or {@link #maxWidth}. The maximum supported value is 500.
24 <span id='Ext-tip.Tip-cfg-minWidth'> /**
25 </span> * @cfg {Number} minWidth The minimum width of the tip in pixels (defaults to 40).
28 <span id='Ext-tip.Tip-cfg-maxWidth'> /**
29 </span> * @cfg {Number} maxWidth The maximum width of the tip in pixels (defaults to 300). The maximum supported value is 500.
32 <span id='Ext-tip.Tip-cfg-shadow'> /**
33 </span> * @cfg {Boolean/String} shadow True or "sides" for the default effect, "frame" for 4-way shadow, and "drop"
34 * for bottom-right shadow (defaults to "sides").
36 shadow : "sides",
38 <span id='Ext-tip.Tip-cfg-defaultAlign'> /**
39 </span> * @cfg {String} defaultAlign <b>Experimental</b>. The default {@link Ext.core.Element#alignTo} anchor position value
40 * for this tip relative to its element of origin (defaults to "tl-bl?").
42 defaultAlign : "tl-bl?",
43 <span id='Ext-tip.Tip-cfg-constrainPosition'> /**
44 </span> * @cfg {Boolean} constrainPosition If true, then the tooltip will be automatically constrained to stay within
45 * the browser viewport. Defaults to false.
47 constrainPosition : true,
49 <span id='Ext-tip.Tip-property-frame'> /**
54 // private panel overrides
57 baseCls: Ext.baseCSSPrefix + 'tip',
63 focusOnToFront: false,
64 componentLayout: 'tip',
70 initComponent: function() {
71 this.callParent(arguments);
73 // Or in the deprecated config. Floating.doConstrain only constrains if the constrain property is truthy.
74 this.constrain = this.constrain || this.constrainPosition;
77 <span id='Ext-tip.Tip-method-showAt'> /**
78 </span> * Shows this tip at the specified XY position. Example usage:
79 * <pre><code>
80 // Show the tip at x:50 and y:100
82 </code></pre>
83 * @param {Array} xy An array containing the x and y coordinates
85 showAt : function(xy){
88 // Show may have been vetoed.
90 me.setPagePosition(xy[0], xy[1]);
91 if (me.constrainPosition || me.constrain) {
98 <span id='Ext-tip.Tip-method-showBy'> /**
99 </span> * <b>Experimental</b>. Shows this tip at a position relative to another element using a standard {@link Ext.core.Element#alignTo}
100 * anchor position value. Example usage:
101 * <pre><code>
102 // Show the tip at the default position ('tl-br?')
105 // Show the tip's top-left corner anchored to the element's top-right corner
106 tip.showBy('my-el', 'tl-tr');
107 </code></pre>
108 * @param {Mixed} el An HTMLElement, Ext.core.Element or string id of the target element to align to
109 * @param {String} position (optional) A valid {@link Ext.core.Element#alignTo} anchor position (defaults to 'tl-br?' or
110 * {@link #defaultAlign} if specified).
112 showBy : function(el, pos) {
113 this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign));
116 <span id='Ext-tip.Tip-method-initDraggable'> /**
119 * Set Tip draggable using base Component's draggability
121 initDraggable : function(){
125 delegate: me.header.el,
127 constrainTo: me.el.dom.parentNode
129 // Important: Bypass Panel's initDraggable. Call direct to Component's implementation.
130 Ext.Component.prototype.initDraggable.call(me);
133 // Tip does not ghost. Drag is "live"
137 </pre></pre></body></html>