Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / docs / output / Ext.Resizable.html
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>&#13;&nbsp;&nbsp;<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
6 <pre>\r
7 Value   Description\r
8 ------  -------------------\r
9  'n'     north\r
10  's'     south\r
11  'e'     east\r
12  'w'     west\r
13  'nw'    northwest\r
14  'sw'    southwest\r
15  'se'    southeast\r
16  'ne'    northeast\r
17  'all'   all\r
18 </pre>\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
22     minWidth: 200,\r
23     minHeight: 100,\r
24     maxWidth: 500,\r
25     maxHeight: 400,\r
26     pinned: true\r
27 });\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">&nbsp;</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&#13;\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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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).&#13;\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">&nbsp;</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">&nbsp;</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">&nbsp;</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;
49     },
50
51     <i>// Component passes itself into plugin&#39;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);
57             } <b>else</b> {
58                 l[p].fn = this.createHandler(l[p].fn, c);
59             }
60         }
61
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();
65             <b>if</b> (e) {
66                 e.on(l);
67             }
68         });
69     },
70
71     createHandler: <b>function</b>(fn, c) {
72         <b>return</b> <b>function</b>(e) {
73             fn.call(this, e, c);
74         };
75     }
76 });
77
78 <b>var</b> combo = <b>new</b> Ext.form.ComboBox({
79
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) {
83             comp.collapse();
84         }
85     })],
86     store: myStore,
87     typeAhead: true,
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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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&#13;\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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</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)&#13;\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">&nbsp;</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">&nbsp;</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.&#13;\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">&nbsp;</a></td><td class="sig"><a id="Ext.Resizable-Resizable"></a><b><a href="source/Resizable.html#cls-Ext.Resizable">Resizable</a></b>(&nbsp;<code>Mixed&nbsp;el</code>,&nbsp;<code>Object&nbsp;config</code>&nbsp;)\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">&nbsp;</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>(&nbsp;<code>Object|String&nbsp;o</code>,&nbsp;<code>string&nbsp;Optional.</code>&nbsp;)\r
101     :\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">&nbsp;</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>(&nbsp;<code>String&nbsp;eventName</code>,&nbsp;<code>Function&nbsp;handler</code>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;scope</code>]</span>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;options</code>]</span>&nbsp;)\r
105     :\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>
118 </ul><br>
119 <p>
120 <b>Combining Options</b><br>
121 Using the options argument, it is possible to combine different types of listeners:<br>
122 <br>
123 A delayed, one-time listener.
124 <pre><code>myDataView.on(<em>'click'</em>, this.onClick, this, {
125 single: true,
126 delay: 100
127 });</code></pre>
128 <p>
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.
132 <p>
133 <pre><code>myGridPanel.on({
134 <em>'click'</em> : {
135     fn: this.onClick,
136     scope: this,
137     delay: 100
138 },
139 <em>'mouseover'</em> : {
140     fn: this.onMouseOver,
141     scope: this
142 },
143 <em>'mouseout'</em> : {
144     fn: this.onMouseOut,
145     scope: this
146 }
147 });</code></pre>
148 <p>
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,
154  scope: this
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">&nbsp;</a></td><td class="sig"><a id="Ext.Resizable-destroy"></a><b><a href="source/Resizable.html#method-Ext.Resizable-destroy">destroy</a></b>(&nbsp;<span title="Optional" class="optional">[<code>Boolean&nbsp;removeEl</code>]</span>&nbsp;)\r
156     :\r
157                                         void<div class="mdesc"><div class="short">Destroys this resizable. If the element was wrapped and &#13;\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">&nbsp;</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>(&nbsp;<code>String/Array&nbsp;events</code>&nbsp;)\r
160     :\r
161                                         void<div class="mdesc"><div class="short">Enables events fired by this Observable to bubble up an owner hierarchy by calling&#13;\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&#39;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
171     }),\r
172 \r
173     <i>//  We know that we want Field&#39;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
177         }\r
178         <b>return</b> this.formPanel;\r
179     }\r
180 });\r
181 \r
182 <b>var</b> myForm = <b>new</b> Ext.formPanel({\r
183     title: <em>'User Details'</em>,\r
184     items: [{\r
185         ...\r
186     }],\r
187     listeners: {\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
191         }\r
192     }\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">&nbsp;</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>(&nbsp;<code>String&nbsp;eventName</code>,&nbsp;<code>Object...&nbsp;args</code>&nbsp;)\r
194     :\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">&nbsp;</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
199     :\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">&nbsp;</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
201     :\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">&nbsp;</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>(&nbsp;<code>String&nbsp;eventName</code>&nbsp;)\r
203     :\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">&nbsp;</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>(&nbsp;<code>String&nbsp;eventName</code>,&nbsp;<code>Function&nbsp;handler</code>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;scope</code>]</span>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;options</code>]</span>&nbsp;)\r
205     :\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">&nbsp;</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
208     :\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">&nbsp;</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>(&nbsp;<code>Object&nbsp;o</code>,&nbsp;<code>Array&nbsp;events</code>&nbsp;)\r
210     :\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">&nbsp;</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>(&nbsp;<code>String&nbsp;eventName</code>,&nbsp;<code>Function&nbsp;handler</code>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;scope</code>]</span>&nbsp;)\r
212     :\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">&nbsp;</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
214     :\r
215                                         void<div class="mdesc"><div class="short">Performs resizing of the associated Element. This method is called internally by this&#13;\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
223 Element. Example:\r
224 <pre><code><b>new</b> Ext.Panel({\r
225     title: <em>'Resize me'</em>,\r
226     x: 100,\r
227     y: 100,\r
228     renderTo: Ext.getBody(),\r
229     floating: true,\r
230     frame: true,\r
231     width: 400,\r
232     height: 200,\r
233     listeners: {\r
234         render: <b>function</b>(p) {\r
235             <b>new</b> Ext.Resizable(p.getEl(), {\r
236                 handles: <em>'all'</em>,\r
237                 pinned: true,\r
238                 transparent: true,\r
239                 resizeElement: <b>function</b>() {\r
240                     <b>var</b> box = this.proxy.getBox();\r
241                     p.updateBox(box);\r
242                     <b>if</b> (p.layout) {\r
243                         p.doLayout();\r
244                     }\r
245                     <b>return</b> box;\r
246                 }\r
247            });\r
248        }\r
249     }\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">&nbsp;</a></td><td class="sig"><a id="Ext.Resizable-resizeTo"></a><b><a href="source/Resizable.html#method-Ext.Resizable-resizeTo">resizeTo</a></b>(&nbsp;<code>Number&nbsp;width</code>,&nbsp;<code>Number&nbsp;height</code>&nbsp;)\r
251     :\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">&nbsp;</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
253     :\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">&nbsp;</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>(&nbsp;<code>Boolean&nbsp;queueSuspended</code>&nbsp;)\r
259     :\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">&nbsp;</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>(&nbsp;<code>String&nbsp;eventName</code>,&nbsp;<code>Function&nbsp;handler</code>,&nbsp;<span title="Optional" class="optional">[<code>Object&nbsp;scope</code>]</span>&nbsp;)\r
262     :\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">&nbsp;</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                                       (&nbsp;<code>Ext.Resizable&nbsp;this</code>,&nbsp;<code>Ext.EventObject&nbsp;e</code>&nbsp;)\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">&nbsp;</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                                       (&nbsp;<code>Ext.Resizable&nbsp;this</code>,&nbsp;<code>Number&nbsp;width</code>,&nbsp;<code>Number&nbsp;height</code>,&nbsp;<code>Ext.EventObject&nbsp;e</code>&nbsp;)\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>