1 <div xmlns:ext="http://www.extjs.com" class="body-wrap"><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.Observable.html" ext:member="" ext:cls="Ext.util.Observable">Observable</a> <img src="resources/elbow-end.gif">Resizable</pre></div><h1>Class <a href="source/Resizable.html#cls-Ext.Resizable">Ext.Resizable</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">Resizable.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/Resizable.html#cls-Ext.Resizable">Resizable</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.util.Observable.html" ext:cls="Ext.util.Observable" ext:member="">Observable</a></td></tr></table><div class="description"><p>Applies drag handles to an element to make it resizable. The drag handles are inserted into the element
\r
2 and positioned absolute. Some elements, such as a textarea or image, don't support this. To overcome that, you can wrap
\r
3 the textarea in a div and set 'resizeChild' to true (or to the id of the element), <b>or</b> set wrap:true in your config and
\r
4 the element will be wrapped for you automatically.</p>
\r
5 <p>Here is the list of valid resize handles:</p>
\r
8 ------ -------------------
\r
19 <p>Here's an example showing the creation of a typical Resizable:</p>
\r
20 <pre><code><b>var</b> resizer = <b>new</b> Ext.Resizable(<em>'element-id'</em>, {
\r
21 handles: <em>'all'</em>,
\r
28 resizer.on(<em>'resize'</em>, myHandler);</code></pre>
\r
29 <p>To hide a particular handle, set its display to none in CSS, or through script:<br>
\r
30 resizer.east.setDisplayed(false);</p></div><div class="hr"></div><a id="Ext.Resizable-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-adjustments"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-adjustments">adjustments</a></b> : Array/String<div class="mdesc"><div class="short">String 'auto' or an array [width, height] with values to be added to the
\r
31 resize operation's new size (defaults to [0...</div><div class="long">String 'auto' or an array [width, height] with values to be <b>added</b> to the
\r
32 resize operation's new size (defaults to <tt>[0, 0]</tt>)</div></div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-animate"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-animate">animate</a></b> : Boolean<div class="mdesc">True to animate the resize (not compatible with dynamic sizing, defaults to false)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-constrainTo"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-constrainTo">constrainTo</a></b> : Mixed<div class="mdesc">Constrain the resize to a particular element</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-disableTrackOver"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-disableTrackOver">disableTrackOver</a></b> : Boolean<div class="mdesc">True to disable mouse tracking. This is only applied at config time. (defaults to false)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-draggable"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-draggable">draggable</a></b> : Boolean<div class="mdesc">Convenience to initialize drag drop (defaults to false)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-duration"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-duration">duration</a></b> : Number<div class="mdesc">Animation duration if animate = true (defaults to 0.35)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-dynamic"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-dynamic">dynamic</a></b> : Boolean<div class="mdesc">True to resize the element while dragging instead of using a proxy (defaults to false)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-easing"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-easing">easing</a></b> : String<div class="mdesc">Animation easing if animate = true (defaults to <tt>'easingOutStrong'</tt>)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-enabled"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-enabled">enabled</a></b> : Boolean<div class="mdesc">False to disable resizing (defaults to true)</div></td><td class="msource">Resizable</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-handles"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-handles">handles</a></b> : String<div class="mdesc"><div class="short">String consisting of the resize handles to display (defaults to undefined).
\r
33 Specify either 'all' or any of 'n s e w ...</div><div class="long">String consisting of the resize handles to display (defaults to undefined).
\r
34 Specify either <tt>'all'</tt> or any of <tt>'n s e w ne nw se sw'</tt>.</div></div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-height"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-height">height</a></b> : Number<div class="mdesc">The height of the element in pixels (defaults to null)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-heightIncrement"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-heightIncrement">heightIncrement</a></b> : Number<div class="mdesc">The increment to snap the height resize in pixels
\r
35 (only applies if <code><a href="output/Ext.Resizable.html#Ext.Resizable-dynamic" ext:member="dynamic" ext:cls="Ext.Resizable">dynamic</a>==true</code>). Defaults to <tt>0</tt>.</div></td><td class="msource">Resizable</td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-listeners"></a><b><a href="source/Observable.html#cfg-Ext.util.Observable-listeners">listeners</a></b> : Object<div class="mdesc"><div class="short">A config object containing one or more event handlers to be added to this
\r
36 object during initialization. This should ...</div><div class="long"><p>A config object containing one or more event handlers to be added to this
37 object during initialization. This should be a valid listeners config object as specified in the
38 <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> example for attaching multiple handlers at once.</p>
39 <br><p><b><u>DOM events from ExtJs <a href="output/Ext.Component.html" ext:cls="Ext.Component">Components</a></u></b></p>
40 <br><p>While <i>some</i> ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
41 is usually only done when extra value can be added. For example the <a href="output/Ext.DataView.html" ext:cls="Ext.DataView">DataView</a>'s
42 <b><code><a href="output/Ext.DataView.html#Ext.DataView-click" ext:member="click" ext:cls="Ext.DataView">click</a></code></b> event passing the node clicked on. To access DOM
43 events directly from a Component's HTMLElement, listeners must be added to the <i><a href="output/Ext.Component.html#Ext.Component-getEl" ext:member="getEl" ext:cls="Ext.Component">Element</a></i> after the Component
44 has been rendered. A plugin can simplify this step:<pre><code><i>// Plugin is configured <b>with</b> a listeners config object.</i>
45 <i>// The Component is appended to the argument list of all handler functions.</i>
46 Ext.DomObserver = Ext.extend(Object, {
47 constructor: <b>function</b>(config) {
48 this.listeners = config.listeners ? config.listeners : config;
51 <i>// Component passes itself into plugin's init method</i>
52 init: <b>function</b>(c) {
53 <b>var</b> p, l = this.listeners;
54 <b>for</b> (p <b>in</b> l) {
55 <b>if</b> (Ext.isFunction(l[p])) {
56 l[p] = this.createHandler(l[p], c);
58 l[p].fn = this.createHandler(l[p].fn, c);
62 <i>// Add the listeners to the Element immediately following the render call</i>
63 c.render = c.render.<a href="output/Function.html#Function-createSequence" ext:member="createSequence" ext:cls="Function">createSequence</a>(<b>function</b>() {
64 <b>var</b> e = c.getEl();
71 createHandler: <b>function</b>(fn, c) {
72 <b>return</b> <b>function</b>(e) {
78 <b>var</b> combo = <b>new</b> Ext.form.ComboBox({
80 <i>// Collapse combo when its element is clicked on</i>
81 plugins: [ <b>new</b> Ext.DomObserver({
82 click: <b>function</b>(evt, comp) {
88 mode: <em>'local'</em>,
89 triggerAction: <em>'all'</em>
90 });</code></pre></p></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#listeners" ext:member="#listeners" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-maxHeight"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-maxHeight">maxHeight</a></b> : Number<div class="mdesc">The maximum height for the element (defaults to 10000)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-maxWidth"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-maxWidth">maxWidth</a></b> : Number<div class="mdesc">The maximum width for the element (defaults to 10000)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-minHeight"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-minHeight">minHeight</a></b> : Number<div class="mdesc">The minimum height for the element (defaults to 5)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-minWidth"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-minWidth">minWidth</a></b> : Number<div class="mdesc">The minimum width for the element (defaults to 5)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-minX"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-minX">minX</a></b> : Number<div class="mdesc">The minimum x for the element (defaults to 0)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-minY"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-minY">minY</a></b> : Number<div class="mdesc">The minimum x for the element (defaults to 0)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-multiDirectional"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-multiDirectional">multiDirectional</a></b> : Boolean<div class="mdesc"><b>Deprecated</b>. Deprecated style of adding multi-direction resize handles.</div></td><td class="msource">Resizable</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-pinned"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-pinned">pinned</a></b> : Boolean<div class="mdesc"><div class="short">True to ensure that the resize handles are always visible, false to display them only when the
\r
91 user mouses over the ...</div><div class="long">True to ensure that the resize handles are always visible, false to display them only when the
\r
92 user mouses over the resizable borders. This is only applied at config time. (defaults to false)</div></div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-preserveRatio"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-preserveRatio">preserveRatio</a></b> : Boolean<div class="mdesc">True to preserve the original ratio between height
\r
93 and width during resize (defaults to false)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-resizeChild"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-resizeChild">resizeChild</a></b> : Boolean/String/Element<div class="mdesc">True to resize the first child, or id/element to resize (defaults to false)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-resizeRegion"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-resizeRegion">resizeRegion</a></b> : Ext.lib.Region<div class="mdesc">Constrain the resize to a particular region</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-transparent"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-transparent">transparent</a></b> : Boolean<div class="mdesc">True for transparent handles. This is only applied at config time. (defaults to false)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-width"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-width">width</a></b> : Number<div class="mdesc">The width of the element in pixels (defaults to null)</div></td><td class="msource">Resizable</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-widthIncrement"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-widthIncrement">widthIncrement</a></b> : Number<div class="mdesc">The increment to snap the width resize in pixels
\r
94 (only applies if <code><a href="output/Ext.Resizable.html#Ext.Resizable-dynamic" ext:member="dynamic" ext:cls="Ext.Resizable">dynamic</a>==true</code>). Defaults to <tt>0</tt>.</div></td><td class="msource">Resizable</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-wrap"></a><b><a href="source/Resizable.html#cfg-Ext.Resizable-wrap">wrap</a></b> : Boolean<div class="mdesc"><div class="short">True to wrap an element with a div if needed (required for textareas and images, defaults to false)
\r
95 in favor of the ...</div><div class="long">True to wrap an element with a div if needed (required for textareas and images, defaults to false)
\r
96 in favor of the handles config option (defaults to false)</div></div></td><td class="msource">Resizable</td></tr></tbody></table><a id="Ext.Resizable-props"></a><h2>Public Properties</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Property</th><th class="msource-header">Defined By</th></tr><tr class="property-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-enabled"></a><b><a href="source/Resizable.html#prop-Ext.Resizable-enabled">enabled</a></b> : Boolean<div class="mdesc">Writable. False if resizing is disabled.</div></td><td class="msource">Resizable</td></tr><tr class="property-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-proxy"></a><b><a href="source/Resizable.html#prop-Ext.Resizable-proxy">proxy</a></b> : Ext.Element.<div class="mdesc"><div class="short">The proxy Element that is resized in place of the real Element during the resize operation.
\r
97 This may be queried usin...</div><div class="long">The proxy Element that is resized in place of the real Element during the resize operation.
\r
98 This may be queried using <a href="output/Ext.Element.html#Ext.Element-getBox" ext:member="getBox" ext:cls="Ext.Element">Ext.Element.getBox</a> to provide the new area to resize to.
\r
99 Read only.</div></div></td><td class="msource">Resizable</td></tr></tbody></table><a id="Ext.Resizable-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-Resizable"></a><b><a href="source/Resizable.html#cls-Ext.Resizable">Resizable</a></b>( <code>Mixed el</code>, <code>Object config</code> )
\r
100 <div class="mdesc"><div class="short">Create a new resizable component</div><div class="long">Create a new resizable component<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>el</code> : Mixed<div class="sub-desc">The id or element to resize</div></li><li><code>config</code> : Object<div class="sub-desc">configuration options</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Resizable</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-addEvents"></a><b><a href="source/Observable.html#method-Ext.util.Observable-addEvents">addEvents</a></b>( <code>Object|String o</code>, <code>string Optional.</code> )
\r
102 void<div class="mdesc"><div class="short">Adds the specified events to the list of events which this Observable may fire.</div><div class="long">Adds the specified events to the list of events which this Observable may fire.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>o</code> : Object|String<div class="sub-desc">Either an object with event names as properties with a value of <code>true</code>
103 or the first event name string if multiple event names are being passed as separate parameters.</div></li><li><code>Optional.</code> : string<div class="sub-desc">Event name if multiple event names are being passed as separate parameters.
104 Usage:<pre><code>this.addEvents(<em>'storeloaded'</em>, <em>'storecleared'</em>);</code></pre></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addEvents" ext:member="#addEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-addListener"></a><b><a href="source/Observable.html#method-Ext.util.Observable-addListener">addListener</a></b>( <code>String eventName</code>, <code>Function handler</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span>, <span title="Optional" class="optional">[<code>Object options</code>]</span> )
\r
106 void<div class="mdesc"><div class="short">Appends an event handler to this object.</div><div class="long">Appends an event handler to this object.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to listen for.</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
107 <b>If omitted, defaults to the object which fired the event.</b></div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration.
108 properties. This may contain any of the following properties:<ul>
109 <li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
110 <b>If omitted, defaults to the object which fired the event.</b></div></li>
111 <li><b>delay</b> : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
112 <li><b>single</b> : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
113 <li><b>buffer</b> : Number<div class="sub-desc">Causes the handler to be scheduled to run in an <a href="output/Ext.util.DelayedTask.html" ext:cls="Ext.util.DelayedTask">Ext.util.DelayedTask</a> delayed
114 by the specified number of milliseconds. If the event fires again within that time, the original
115 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
116 <li><b>target</b> : Observable<div class="sub-desc">Only call the handler if the event was fired on the target Observable, <i>not</i>
117 if the event was bubbled up from a child Observable.</div></li>
120 <b>Combining Options</b><br>
121 Using the options argument, it is possible to combine different types of listeners:<br>
123 A delayed, one-time listener.
124 <pre><code>myDataView.on(<em>'click'</em>, this.onClick, this, {
129 <b>Attaching multiple handlers in 1 call</b><br>
130 The method also allows for a single argument to be passed which is a config object containing properties
131 which specify multiple handlers.
133 <pre><code>myGridPanel.on({
139 <em>'mouseover'</em> : {
140 fn: this.onMouseOver,
143 <em>'mouseout'</em> : {
149 Or a shorthand syntax:<br>
150 <pre><code>myGridPanel.on({
151 <em>'click'</em> : this.onClick,
152 <em>'mouseover'</em> : this.onMouseOver,
153 <em>'mouseout'</em> : this.onMouseOut,
155 });</code></pre></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addListener" ext:member="#addListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-destroy"></a><b><a href="source/Resizable.html#method-Ext.Resizable-destroy">destroy</a></b>( <span title="Optional" class="optional">[<code>Boolean removeEl</code>]</span> )
\r
157 void<div class="mdesc"><div class="short">Destroys this resizable. If the element was wrapped and
\r
158 removeEl is not true then the element remains.</div><div class="long">Destroys this resizable. If the element was wrapped and
\r
159 removeEl is not true then the element remains.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>removeEl</code> : Boolean<div class="sub-desc">(optional) true to remove the element from the DOM</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Resizable</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-enableBubble"></a><b><a href="source/Observable-more.html#method-Ext.util.Observable-enableBubble">enableBubble</a></b>( <code>String/Array events</code> )
\r
161 void<div class="mdesc"><div class="short">Enables events fired by this Observable to bubble up an owner hierarchy by calling
\r
162 this.getBubbleTarget() if present...</div><div class="long"><p>Enables events fired by this Observable to bubble up an owner hierarchy by calling
\r
163 <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p>
\r
164 <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="output/Ext.Component.getBubbleTarget.html" ext:cls="Ext.Component.getBubbleTarget">Ext.Component.getBubbleTarget</a>. The default
\r
165 implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
\r
166 access the required target more quickly.</p>
\r
167 <p>Example:</p><pre><code>Ext.override(Ext.form.Field, {
\r
168 <i>// Add functionality to Field's initComponent to enable the change event to bubble
\r</i>
169 initComponent : Ext.form.Field.prototype.initComponent.createSequence(<b>function</b>() {
\r
170 this.enableBubble(<em>'change'</em>);
\r
173 <i>// We know that we want Field's events to bubble directly to the FormPanel.
\r</i>
174 getBubbleTarget : <b>function</b>() {
\r
175 <b>if</b> (!this.formPanel) {
\r
176 this.formPanel = this.findParentByType(<em>'form'</em>);
\r
178 <b>return</b> this.formPanel;
\r
182 <b>var</b> myForm = <b>new</b> Ext.formPanel({
\r
183 title: <em>'User Details'</em>,
\r
188 change: <b>function</b>() {
\r
189 <i>// Title goes red <b>if</b> form has been modified.
\r</i>
190 myForm.header.setStyle(<em>'color'</em>, <em>'red'</em>);
\r
193 });</code></pre><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>events</code> : String/Array<div class="sub-desc">The event name to bubble, or an Array of event names.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#enableBubble" ext:member="#enableBubble" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-fireEvent"></a><b><a href="source/Observable.html#method-Ext.util.Observable-fireEvent">fireEvent</a></b>( <code>String eventName</code>, <code>Object... args</code> )
\r
195 Boolean<div class="mdesc"><div class="short">Fires the specified event with the passed parameters (minus the event name).
\r
196 An event may be set to bubble up an Obse...</div><div class="long"><p>Fires the specified event with the passed parameters (minus the event name).</p>
197 <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="output/Ext.Component.html#Ext.Component-getBubbleTarget" ext:member="getBubbleTarget" ext:cls="Ext.Component">Ext.Component.getBubbleTarget</a>)
198 by calling <a href="output/Ext.util.Observable.html#Ext.util.Observable-enableBubble" ext:member="enableBubble" ext:cls="Ext.util.Observable">enableBubble</a>.</p><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to fire.</div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers.</div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true.</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#fireEvent" ext:member="#fireEvent" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-getEl"></a><b><a href="source/Resizable.html#method-Ext.Resizable-getEl">getEl</a></b>()
\r
200 Ext.Element<div class="mdesc"><div class="short">Returns the element this component is bound to.</div><div class="long">Returns the element this component is bound to.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Ext.Element</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource">Resizable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-getResizeChild"></a><b><a href="source/Resizable.html#method-Ext.Resizable-getResizeChild">getResizeChild</a></b>()
\r
202 Ext.Element<div class="mdesc"><div class="short">Returns the resizeChild element (or null).</div><div class="long">Returns the resizeChild element (or null).<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Ext.Element</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource">Resizable</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-hasListener"></a><b><a href="source/Observable.html#method-Ext.util.Observable-hasListener">hasListener</a></b>( <code>String eventName</code> )
\r
204 Boolean<div class="mdesc"><div class="short">Checks to see if this object has any listeners for a specified event</div><div class="long">Checks to see if this object has any listeners for a specified event<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#hasListener" ext:member="#hasListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-on"></a><b><a href="source/Observable.html#method-Ext.util.Observable-on">on</a></b>( <code>String eventName</code>, <code>Function handler</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span>, <span title="Optional" class="optional">[<code>Object options</code>]</span> )
\r
206 void<div class="mdesc"><div class="short">Appends an event handler to this object (shorthand for addListener.)</div><div class="long">Appends an event handler to this object (shorthand for <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a>.)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
207 <b>If omitted, defaults to the object which fired the event.</b></div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#on" ext:member="#on" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-purgeListeners"></a><b><a href="source/Observable.html#method-Ext.util.Observable-purgeListeners">purgeListeners</a></b>()
\r
209 void<div class="mdesc"><div class="short">Removes all listeners for this object</div><div class="long">Removes all listeners for this object<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#purgeListeners" ext:member="#purgeListeners" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-relayEvents"></a><b><a href="source/Observable-more.html#method-Ext.util.Observable-relayEvents">relayEvents</a></b>( <code>Object o</code>, <code>Array events</code> )
\r
211 void<div class="mdesc"><div class="short">Relays selected events from the specified Observable as if the events were fired by this.</div><div class="long">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>o</code> : Object<div class="sub-desc">The Observable whose events this object is to relay.</div></li><li><code>events</code> : Array<div class="sub-desc">Array of event names to relay.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#relayEvents" ext:member="#relayEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-removeListener"></a><b><a href="source/Observable.html#method-Ext.util.Observable-removeListener">removeListener</a></b>( <code>String eventName</code>, <code>Function handler</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span> )
\r
213 void<div class="mdesc"><div class="short">Removes an event handler.</div><div class="long">Removes an event handler.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event the handler was associated with.</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove. <b>This must be a reference to the function passed into the <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> call.</b></div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope originally specified for the handler.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#removeListener" ext:member="#removeListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-resizeElement"></a><b><a href="source/Resizable.html#method-Ext.Resizable-resizeElement">resizeElement</a></b>()
\r
215 void<div class="mdesc"><div class="short">Performs resizing of the associated Element. This method is called internally by this
\r
216 class, and should not be calle...</div><div class="long"><p>Performs resizing of the associated Element. This method is called internally by this
\r
217 class, and should not be called by user code.</p>
\r
218 <p>If a Resizable is being used to resize an Element which encapsulates a more complex UI
\r
219 component such as a Panel, this method may be overridden by specifying an implementation
\r
220 as a config option to provide appropriate behaviour at the end of the resize operation on
\r
221 mouseup, for example resizing the Panel, and relaying the Panel's content.</p>
\r
222 <p>The new area to be resized to is available by examining the state of the <a href="output/Ext.Resizable.html#Ext.Resizable-proxy" ext:member="proxy" ext:cls="Ext.Resizable">proxy</a>
\r
224 <pre><code><b>new</b> Ext.Panel({
\r
225 title: <em>'Resize me'</em>,
\r
228 renderTo: Ext.getBody(),
\r
234 render: <b>function</b>(p) {
\r
235 <b>new</b> Ext.Resizable(p.getEl(), {
\r
236 handles: <em>'all'</em>,
\r
239 resizeElement: <b>function</b>() {
\r
240 <b>var</b> box = this.proxy.getBox();
\r
242 <b>if</b> (p.layout) {
\r
250 }).show();</code></pre><div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Resizable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-resizeTo"></a><b><a href="source/Resizable.html#method-Ext.Resizable-resizeTo">resizeTo</a></b>( <code>Number width</code>, <code>Number height</code> )
\r
252 void<div class="mdesc"><div class="short">Perform a manual resize and fires the 'resize' event.</div><div class="long">Perform a manual resize and fires the 'resize' event.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>width</code> : Number<div class="sub-desc"></div></li><li><code>height</code> : Number<div class="sub-desc"></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">Resizable</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-resumeEvents"></a><b><a href="source/Observable.html#method-Ext.util.Observable-resumeEvents">resumeEvents</a></b>()
\r
254 void<div class="mdesc"><div class="short">Resume firing events. (see suspendEvents)
\r
255 If events were suspended using the queueSuspended parameter, then all
\r
256 event...</div><div class="long">Resume firing events. (see <a href="output/Ext.util.Observable.html#Ext.util.Observable-suspendEvents" ext:member="suspendEvents" ext:cls="Ext.util.Observable">suspendEvents</a>)
257 If events were suspended using the <tt><b>queueSuspended</b></tt> parameter, then all
258 events fired during event suspension will be sent to any listeners now.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#resumeEvents" ext:member="#resumeEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-suspendEvents"></a><b><a href="source/Observable.html#method-Ext.util.Observable-suspendEvents">suspendEvents</a></b>( <code>Boolean queueSuspended</code> )
\r
260 void<div class="mdesc"><div class="short">Suspend the firing of all events. (see resumeEvents)</div><div class="long">Suspend the firing of all events. (see <a href="output/Ext.util.Observable.html#Ext.util.Observable-resumeEvents" ext:member="resumeEvents" ext:cls="Ext.util.Observable">resumeEvents</a>)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>queueSuspended</code> : Boolean<div class="sub-desc">Pass as true to queue up suspended events to be fired
261 after the <a href="output/Ext.util.Observable.html#Ext.util.Observable-resumeEvents" ext:member="resumeEvents" ext:cls="Ext.util.Observable">resumeEvents</a> call instead of discarding all suspended events;</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#suspendEvents" ext:member="#suspendEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-un"></a><b><a href="source/Observable.html#method-Ext.util.Observable-un">un</a></b>( <code>String eventName</code>, <code>Function handler</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span> )
\r
263 void<div class="mdesc"><div class="short">Removes an event handler (shorthand for removeListener.)</div><div class="long">Removes an event handler (shorthand for <a href="output/Ext.util.Observable.html#Ext.util.Observable-removeListener" ext:member="removeListener" ext:cls="Ext.util.Observable">removeListener</a>.)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event the handler was associated with.</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove. <b>This must be a reference to the function passed into the <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> call.</b></div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope originally specified for the handler.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#un" ext:member="#un" ext:cls="Ext.util.Observable">Observable</a></td></tr></tbody></table><a id="Ext.Resizable-events"></a><h2>Public Events</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Event</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-beforeresize"></a><b><a href="source/Resizable.html#event-Ext.Resizable-beforeresize">beforeresize</a></b> :
\r
264 ( <code>Ext.Resizable this</code>, <code>Ext.EventObject e</code> )
\r
265 <div class="mdesc"><div class="short">Fired before resize is allowed. Set enabled to false to cancel resize.</div><div class="long">Fired before resize is allowed. Set <a href="output/Ext.Resizable.html#Ext.Resizable-enabled" ext:member="enabled" ext:cls="Ext.Resizable">enabled</a> to false to cancel resize.<div class="mdetail-params"><strong style="font-weight: normal;">Listeners will be called with the following arguments:</strong><ul><li><code>this</code> : Ext.Resizable<div class="sub-desc"></div></li><li><code>e</code> : Ext.EventObject<div class="sub-desc">The mousedown event</div></li></ul></div></div></div></td><td class="msource">Resizable</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.Resizable-resize"></a><b><a href="source/Resizable.html#event-Ext.Resizable-resize">resize</a></b> :
\r
266 ( <code>Ext.Resizable this</code>, <code>Number width</code>, <code>Number height</code>, <code>Ext.EventObject e</code> )
\r
267 <div class="mdesc"><div class="short">Fired after a resize.</div><div class="long">Fired after a resize.<div class="mdetail-params"><strong style="font-weight: normal;">Listeners will be called with the following arguments:</strong><ul><li><code>this</code> : Ext.Resizable<div class="sub-desc"></div></li><li><code>width</code> : Number<div class="sub-desc">The new width</div></li><li><code>height</code> : Number<div class="sub-desc">The new height</div></li><li><code>e</code> : Ext.EventObject<div class="sub-desc">The mouseup event</div></li></ul></div></div></div></td><td class="msource">Resizable</td></tr></tbody></table></div>