1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.menu.Menu-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.menu.Menu-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.menu.Menu-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.menu.Menu-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7 <a class="bookmark" href="../docs/?class=Ext.menu.Menu"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
9 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a>
11 <img src="resources/elbow-end.gif"/>Menu</pre></div>
12 <h1>Class Ext.menu.Menu</h1>
13 <table cellspacing="0">
14 <tr><td class="label">Package:</td><td class="hd-info">Ext.menu</td></tr>
15 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/Menu.js" target="_blank">Menu.js</a></td></tr>
16 <tr><td class="label">Class:</td><td class="hd-info">Menu</td></tr>
17 <tr><td class="label">Subclasses:</td><td class="hd-info"><a ext:cls="Ext.menu.ColorMenu" href="output/Ext.menu.ColorMenu.html">ColorMenu</a>, <a ext:cls="Ext.menu.DateMenu" href="output/Ext.menu.DateMenu.html">DateMenu</a></td></tr>
18 <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a></td></tr>
20 <div class="description">
22 A menu object. This is the container to which you add all other menu items. Menu can also serve as a base class
23 when you want a specialized menu based off of another component (like <a ext:cls="Ext.menu.DateMenu" href="output/Ext.menu.DateMenu.html">Ext.menu.DateMenu</a> for example). </div>
25 <div class="hr"></div>
26 <a id="Ext.menu.Menu-configs"></a>
27 <h2>Config Options</h2>
28 <table cellspacing="0" class="member-table">
30 <th class="sig-header" colspan="2">Config Options</th>
31 <th class="msource-header">Defined By</th>
33 <tr class="config-row">
\r
34 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
36 <a id="Ext.menu.Menu-allowOtherMenus"></a>
\r
37 <b>allowOtherMenus</b> : Boolean <div class="mdesc">
\r
38 True to allow multiple menus to be displayed at the same time (defaults to false) </div>
\r
40 <td class="msource">Menu</td>
\r
42 <tr class="config-row alt expandable">
\r
43 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
45 <a id="Ext.menu.Menu-defaultAlign"></a>
\r
46 <b>defaultAlign</b> : String <div class="mdesc">
\r
47 <div class="short">The default Ext.Element.alignTo anchor position value for this menu relative to its element of origin (defaults to "t...</div>
\r
49 The default <a ext:cls="Ext.Element" ext:member="alignTo" href="output/Ext.Element.html#alignTo">Ext.Element.alignTo</a> anchor position value for this menu relative to its element of origin (defaults to "tl-bl?") </div>
\r
52 <td class="msource">Menu</td>
\r
54 <tr class="config-row expandable">
\r
55 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
57 <a id="Ext.menu.Menu-defaults"></a>
\r
58 <b>defaults</b> : Object <div class="mdesc">
\r
59 <div class="short">A config object that will be applied to all items added to this container either via the items config or via the add ...</div>
\r
61 A config object that will be applied to all items added to this container either via the <a ext:cls="Ext.menu.Menu" ext:member="items" href="output/Ext.menu.Menu.html#items">items</a> config or via the <a ext:cls="Ext.menu.Menu" ext:member="add" href="output/Ext.menu.Menu.html#add">add</a> method. The defaults config can contain any number of name/value property pairs to be added to each item, and should be valid for the types of items being added to the menu. </div>
\r
64 <td class="msource">Menu</td>
\r
66 <tr class="config-row alt expandable">
\r
67 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
69 <a id="Ext.menu.Menu-ignoreParentClicks"></a>
\r
70 <b>ignoreParentClicks</b> : Boolean <div class="mdesc">
\r
71 <div class="short">True to ignore clicks on any item in this menu that is a parent item (displays a submenu) so that the submenu is not ...</div>
\r
73 True to ignore clicks on any item in this menu that is a parent item (displays a submenu) so that the submenu is not dismissed when clicking the parent item (defaults to false). </div>
\r
76 <td class="msource">Menu</td>
\r
78 <tr class="config-row">
\r
79 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
81 <a id="Ext.menu.Menu-items"></a>
\r
82 <b>items</b> : Mixed <div class="mdesc">
\r
83 An array of items to be added to this menu. See <a ext:cls="Ext.menu.Menu" ext:member="add" href="output/Ext.menu.Menu.html#add">add</a> for a list of valid item types. </div>
\r
85 <td class="msource">Menu</td>
\r
87 <tr class="config-row inherited alt expandable">
\r
88 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
90 <a id="Ext.menu.Menu-listeners"></a>
\r
91 <b>listeners</b> : Object <div class="mdesc">
\r
92 <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
\r
94 (optional) A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the <a ext:cls="Ext.util.Observable" ext:member="addListener" href="output/Ext.util.Observable.html#addListener">addListener</a> example for attaching multiple handlers at once. </div>
\r
97 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
\r
99 <tr class="config-row">
\r
100 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
102 <a id="Ext.menu.Menu-minWidth"></a>
\r
103 <b>minWidth</b> : Number <div class="mdesc">
\r
104 The minimum width of the menu in pixels (defaults to 120) </div>
\r
106 <td class="msource">Menu</td>
\r
108 <tr class="config-row alt expandable">
\r
109 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
111 <a id="Ext.menu.Menu-shadow"></a>
\r
112 <b>shadow</b> : Boolean/String <div class="mdesc">
\r
113 <div class="short">True or "sides" for the default effect, "frame" for 4-way shadow, and "drop" for bottom-right shadow (defaults to "si...</div>
\r
115 True or "sides" for the default effect, "frame" for 4-way shadow, and "drop" for bottom-right shadow (defaults to "sides") </div>
\r
118 <td class="msource">Menu</td>
\r
120 <tr class="config-row">
\r
121 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
123 <a id="Ext.menu.Menu-subMenuAlign"></a>
\r
124 <b>subMenuAlign</b> : String <div class="mdesc">
\r
125 The <a ext:cls="Ext.Element" ext:member="alignTo" href="output/Ext.Element.html#alignTo">Ext.Element.alignTo</a> anchor position value to use for submenus of this menu (defaults to "tl-tr?") </div>
\r
127 <td class="msource">Menu</td>
\r
130 <a id="Ext.menu.Menu-props"></a>
131 <h2>Public Properties</h2>
132 <table cellspacing="0" class="member-table">
134 <th class="sig-header" colspan="2">Property</th>
135 <th class="msource-header">Defined By</th>
137 <tr class="property-row">
\r
138 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
140 <a id="Ext.menu.Menu-items"></a>
\r
141 <b>items</b> : Ext.util.MixedCollection <div class="mdesc">
\r
142 A MixedCollection of this Menu's items </div>
\r
144 <td class="msource">Menu</td>
\r
147 <a id="Ext.menu.Menu-methods"></a>
148 <h2>Public Methods</h2>
149 <table cellspacing="0" class="member-table">
151 <th class="sig-header" colspan="2">Method</th>
152 <th class="msource-header">Defined By</th>
154 <tr class="method-row expandable">
\r
155 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
157 <a id="Ext.menu.Menu-Menu"></a>
\r
158 <b>Menu</b>( <code>Object config</code> ) <div class="mdesc">
\r
159 <div class="short">Creates a new Menu</div>
\r
161 Creates a new Menu <div class="mdetail-params">
\r
162 <strong>Parameters:</strong>
\r
163 <ul><li><code>config</code> : Object<div class="sub-desc">Configuration options</div></li> </ul>
\r
164 <strong>Returns:</strong>
\r
166 <li><code></code></li>
\r
172 <td class="msource">Menu</td>
\r
174 <tr class="method-row alt expandable">
\r
175 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
177 <a id="Ext.menu.Menu-add"></a>
\r
178 <b>add</b>( <code>Mixed args</code> ) : Ext.menu.Item <div class="mdesc">
\r
179 <div class="short">Adds one or more items of any type supported by the Menu class, or that can be converted into menu items.
180 Any of the ...</div>
\r
182 Adds one or more items of any type supported by the Menu class, or that can be converted into menu items.
183 Any of the following are valid:
185 <li>Any menu item object based on <a ext:cls="Ext.menu.BaseItem" href="output/Ext.menu.BaseItem.html">Ext.menu.BaseItem</a></li>
186 <li>An HTMLElement object which will be converted to a menu item</li>
187 <li>A menu item config object that will be created as a new menu item</li>
188 <li>A string, which can either be '-' or 'separator' to add a menu separator, otherwise
189 it will be converted into a <a ext:cls="Ext.menu.TextItem" href="output/Ext.menu.TextItem.html">Ext.menu.TextItem</a> and added</li>
192 <pre><code><i>// Create the menu</i>
193 <b>var</b> menu = <b>new</b> Ext.menu.Menu();
195 <i>// Create a menu item to add by reference</i>
196 <b>var</b> menuItem = <b>new</b> Ext.menu.Item({ text: <em>'New Item!'</em> });
198 <i>// Add a bunch of items at once using different methods.</i>
199 <i>// Only the last item added will be returned.</i>
200 <b>var</b> item = menu.add(
201 menuItem, <i>// add existing item by ref</i>
202 <em>'Dynamic Item'</em>, <i>// <b>new</b> TextItem</i>
203 <em>'-'</em>, <i>// <b>new</b> separator</i>
204 { text: <em>'Config Item'</em> } <i>// <b>new</b> item by config</i>
205 );</code></pre> <div class="mdetail-params">
\r
206 <strong>Parameters:</strong>
\r
207 <ul><li><code>args</code> : Mixed<div class="sub-desc">One or more menu items, menu item configs or other objects that can be converted to menu items</div></li> </ul>
\r
208 <strong>Returns:</strong>
\r
210 <li><code>Ext.menu.Item</code><div class="sub-desc">The menu item that was added, or the last one if multiple items were added</div></li>
\r
216 <td class="msource">Menu</td>
\r
218 <tr class="method-row expandable">
\r
219 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
221 <a id="Ext.menu.Menu-addElement"></a>
\r
222 <b>addElement</b>( <code>Mixed el</code> ) : Ext.menu.Item <div class="mdesc">
\r
223 <div class="short">Adds an <a ext:cls="Ext.Element" href="output/Ext.Element.html">Ext.Element</a> object to the menu</div>
\r
225 Adds an <a ext:cls="Ext.Element" href="output/Ext.Element.html">Ext.Element</a> object to the menu <div class="mdetail-params">
\r
226 <strong>Parameters:</strong>
\r
227 <ul><li><code>el</code> : Mixed<div class="sub-desc">The element or DOM node to add, or its id</div></li> </ul>
\r
228 <strong>Returns:</strong>
\r
230 <li><code>Ext.menu.Item</code><div class="sub-desc">The menu item that was added</div></li>
\r
236 <td class="msource">Menu</td>
\r
238 <tr class="method-row inherited alt expandable">
\r
239 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
241 <a id="Ext.menu.Menu-addEvents"></a>
\r
242 <b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc">
\r
243 <div class="short">Used to define events on this Observable</div>
\r
245 Used to define events on this Observable <div class="mdetail-params">
\r
246 <strong>Parameters:</strong>
\r
247 <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul>
\r
248 <strong>Returns:</strong>
\r
250 <li><code>void</code></li>
\r
256 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>
\r
258 <tr class="method-row expandable">
\r
259 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
261 <a id="Ext.menu.Menu-addItem"></a>
\r
262 <b>addItem</b>( <code>Ext.menu.Item item</code> ) : Ext.menu.Item <div class="mdesc">
\r
263 <div class="short">Adds an existing object based on <a ext:cls="Ext.menu.BaseItem" href="output/Ext.menu.BaseItem.html">Ext.menu.BaseItem</a> to the menu</div>
\r
265 Adds an existing object based on <a ext:cls="Ext.menu.BaseItem" href="output/Ext.menu.BaseItem.html">Ext.menu.BaseItem</a> to the menu <div class="mdetail-params">
\r
266 <strong>Parameters:</strong>
\r
267 <ul><li><code>item</code> : Ext.menu.Item<div class="sub-desc">The menu item to add</div></li> </ul>
\r
268 <strong>Returns:</strong>
\r
270 <li><code>Ext.menu.Item</code><div class="sub-desc">The menu item that was added</div></li>
\r
276 <td class="msource">Menu</td>
\r
278 <tr class="method-row inherited alt expandable">
\r
279 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
281 <a id="Ext.menu.Menu-addListener"></a>
\r
282 <b>addListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : void <div class="mdesc">
\r
283 <div class="short">Appends an event handler to this component</div>
\r
285 Appends an event handler to this component <div class="mdetail-params">
\r
286 <strong>Parameters:</strong>
\r
287 <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 in which to execute the handler
288 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
289 properties. This may contain any of the following properties:<ul>
290 <li><b>scope</b> : Object<p class="sub-desc">The scope in which to execute the handler function. The handler function's "this" context.</p></li>
291 <li><b>delay</b> : Number<p class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</p></li>
292 <li><b>single</b> : Boolean<p class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</p></li>
293 <li><b>buffer</b> : Number<p class="sub-desc">Causes the handler to be scheduled to run in an <a ext:cls="Ext.util.DelayedTask" href="output/Ext.util.DelayedTask.html">Ext.util.DelayedTask</a> delayed
294 by the specified number of milliseconds. If the event fires again within that time, the original
295 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
298 <b>Combining Options</b><br>
299 Using the options argument, it is possible to combine different types of listeners:<br>
301 A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
302 <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
308 <b>Attaching multiple handlers in 1 call</b><br>
309 The method also allows for a single argument to be passed which is a config object containing properties
310 which specify multiple handlers.
314 fn: <b>this</b>.onClick,
318 <em>'mouseover'</em> : {
319 fn: <b>this</b>.onMouseOver,
322 <em>'mouseout'</em> : {
323 fn: <b>this</b>.onMouseOut,
328 Or a shorthand syntax:<br>
330 <em>'click'</em> : <b>this</b>.onClick,
331 <em>'mouseover'</em> : <b>this</b>.onMouseOver,
332 <em>'mouseout'</em> : <b>this</b>.onMouseOut,
334 });</code></pre></div></li> </ul>
\r
335 <strong>Returns:</strong>
\r
337 <li><code>void</code></li>
\r
343 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>
\r
345 <tr class="method-row expandable">
\r
346 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
348 <a id="Ext.menu.Menu-addMenuItem"></a>
\r
349 <b>addMenuItem</b>( <code>Object config</code> ) : Ext.menu.Item <div class="mdesc">
\r
350 <div class="short">Creates a new <a ext:cls="Ext.menu.Item" href="output/Ext.menu.Item.html">Ext.menu.Item</a> based an the supplied config object and adds it to the menu</div>
\r
352 Creates a new <a ext:cls="Ext.menu.Item" href="output/Ext.menu.Item.html">Ext.menu.Item</a> based an the supplied config object and adds it to the menu <div class="mdetail-params">
\r
353 <strong>Parameters:</strong>
\r
354 <ul><li><code>config</code> : Object<div class="sub-desc">A MenuItem config object</div></li> </ul>
\r
355 <strong>Returns:</strong>
\r
357 <li><code>Ext.menu.Item</code><div class="sub-desc">The menu item that was added</div></li>
\r
363 <td class="msource">Menu</td>
\r
365 <tr class="method-row alt expandable">
\r
366 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
368 <a id="Ext.menu.Menu-addSeparator"></a>
\r
369 <b>addSeparator</b>() : Ext.menu.Item <div class="mdesc">
\r
370 <div class="short">Adds a separator bar to the menu</div>
\r
372 Adds a separator bar to the menu <div class="mdetail-params">
\r
373 <strong>Parameters:</strong>
\r
374 <ul><li>None.</li> </ul>
\r
375 <strong>Returns:</strong>
\r
377 <li><code>Ext.menu.Item</code><div class="sub-desc">The menu item that was added</div></li>
\r
383 <td class="msource">Menu</td>
\r
385 <tr class="method-row expandable">
\r
386 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
388 <a id="Ext.menu.Menu-addText"></a>
\r
389 <b>addText</b>( <code>String text</code> ) : Ext.menu.Item <div class="mdesc">
\r
390 <div class="short">Creates a new <a ext:cls="Ext.menu.TextItem" href="output/Ext.menu.TextItem.html">Ext.menu.TextItem</a> with the supplied text and adds it to the menu</div>
\r
392 Creates a new <a ext:cls="Ext.menu.TextItem" href="output/Ext.menu.TextItem.html">Ext.menu.TextItem</a> with the supplied text and adds it to the menu <div class="mdetail-params">
\r
393 <strong>Parameters:</strong>
\r
394 <ul><li><code>text</code> : String<div class="sub-desc">The text to display in the menu item</div></li> </ul>
\r
395 <strong>Returns:</strong>
\r
397 <li><code>Ext.menu.Item</code><div class="sub-desc">The menu item that was added</div></li>
\r
403 <td class="msource">Menu</td>
\r
405 <tr class="method-row alt expandable">
\r
406 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
408 <a id="Ext.menu.Menu-destroy"></a>
\r
409 <b>destroy</b>() : void <div class="mdesc">
\r
410 <div class="short">Destroys the menu by unregistering it from Ext.menu.MenuMgr, purging event listeners,
411 removing all of the menus item...</div>
\r
413 Destroys the menu by unregistering it from <a ext:cls="Ext.menu.MenuMgr" href="output/Ext.menu.MenuMgr.html">Ext.menu.MenuMgr</a>, purging event listeners,
414 removing all of the menus items, then destroying the underlying <a ext:cls="Ext.Element" href="output/Ext.Element.html">Ext.Element</a> <div class="mdetail-params">
\r
415 <strong>Parameters:</strong>
\r
416 <ul><li>None.</li> </ul>
\r
417 <strong>Returns:</strong>
\r
419 <li><code>void</code></li>
\r
425 <td class="msource">Menu</td>
\r
427 <tr class="method-row inherited expandable">
\r
428 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
430 <a id="Ext.menu.Menu-fireEvent"></a>
\r
431 <b>fireEvent</b>( <code>String eventName</code>, <code>Object... args</code> ) : Boolean <div class="mdesc">
\r
432 <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
\r
434 Fires the specified event with the passed parameters (minus the event name). <div class="mdetail-params">
\r
435 <strong>Parameters:</strong>
\r
436 <ul><li><code>eventName</code> : String<div class="sub-desc"></div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers</div></li> </ul>
\r
437 <strong>Returns:</strong>
\r
439 <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
\r
445 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>
\r
447 <tr class="method-row alt expandable">
\r
448 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
450 <a id="Ext.menu.Menu-getEl"></a>
\r
451 <b>getEl</b>() : Ext.Element <div class="mdesc">
\r
452 <div class="short">Returns this menu's underlying <a ext:cls="Ext.Element" href="output/Ext.Element.html">Ext.Element</a> object</div>
\r
454 Returns this menu's underlying <a ext:cls="Ext.Element" href="output/Ext.Element.html">Ext.Element</a> object <div class="mdetail-params">
\r
455 <strong>Parameters:</strong>
\r
456 <ul><li>None.</li> </ul>
\r
457 <strong>Returns:</strong>
\r
459 <li><code>Ext.Element</code><div class="sub-desc">The element</div></li>
\r
465 <td class="msource">Menu</td>
\r
467 <tr class="method-row inherited expandable">
\r
468 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
470 <a id="Ext.menu.Menu-hasListener"></a>
\r
471 <b>hasListener</b>( <code>String eventName</code> ) : Boolean <div class="mdesc">
\r
472 <div class="short">Checks to see if this object has any listeners for a specified event</div>
\r
474 Checks to see if this object has any listeners for a specified event <div class="mdetail-params">
\r
475 <strong>Parameters:</strong>
\r
476 <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul>
\r
477 <strong>Returns:</strong>
\r
479 <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
\r
485 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>
\r
487 <tr class="method-row alt expandable">
\r
488 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
490 <a id="Ext.menu.Menu-hide"></a>
\r
491 <b>hide</b>( <span class="optional" title="Optional">[<code>Boolean deep</code>]</span> ) : void <div class="mdesc">
\r
492 <div class="short">Hides this menu and optionally all parent menus</div>
\r
494 Hides this menu and optionally all parent menus <div class="mdetail-params">
\r
495 <strong>Parameters:</strong>
\r
496 <ul><li><code>deep</code> : Boolean<div class="sub-desc">(optional) True to hide all parent menus recursively, if any (defaults to false)</div></li> </ul>
\r
497 <strong>Returns:</strong>
\r
499 <li><code>void</code></li>
\r
505 <td class="msource">Menu</td>
\r
507 <tr class="method-row expandable">
\r
508 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
510 <a id="Ext.menu.Menu-insert"></a>
\r
511 <b>insert</b>( <code>Number index</code>, <code>Ext.menu.Item item</code> ) : Ext.menu.Item <div class="mdesc">
\r
512 <div class="short">Inserts an existing object based on <a ext:cls="Ext.menu.BaseItem" href="output/Ext.menu.BaseItem.html">Ext.menu.BaseItem</a> to the menu at a specified index</div>
\r
514 Inserts an existing object based on <a ext:cls="Ext.menu.BaseItem" href="output/Ext.menu.BaseItem.html">Ext.menu.BaseItem</a> to the menu at a specified index <div class="mdetail-params">
\r
515 <strong>Parameters:</strong>
\r
516 <ul><li><code>index</code> : Number<div class="sub-desc">The index in the menu's list of current items where the new item should be inserted</div></li><li><code>item</code> : Ext.menu.Item<div class="sub-desc">The menu item to add</div></li> </ul>
\r
517 <strong>Returns:</strong>
\r
519 <li><code>Ext.menu.Item</code><div class="sub-desc">The menu item that was added</div></li>
\r
525 <td class="msource">Menu</td>
\r
527 <tr class="method-row alt expandable">
\r
528 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
530 <a id="Ext.menu.Menu-isVisible"></a>
\r
531 <b>isVisible</b>() : void <div class="mdesc">
\r
532 <div class="short">Read-only. Returns true if the menu is currently displayed, else false.</div>
\r
534 Read-only. Returns true if the menu is currently displayed, else false. <div class="mdetail-params">
\r
535 <strong>Parameters:</strong>
\r
536 <ul><li>None.</li> </ul>
\r
537 <strong>Returns:</strong>
\r
539 <li><code>void</code></li>
\r
545 <td class="msource">Menu</td>
\r
547 <tr class="method-row inherited expandable">
\r
548 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
550 <a id="Ext.menu.Menu-on"></a>
\r
551 <b>on</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : void <div class="mdesc">
\r
552 <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
\r
554 Appends an event handler to this element (shorthand for addListener) <div class="mdetail-params">
\r
555 <strong>Parameters:</strong>
\r
556 <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 in which to execute the handler
557 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
\r
558 <strong>Returns:</strong>
\r
560 <li><code>void</code></li>
\r
566 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>
\r
568 <tr class="method-row inherited alt expandable">
\r
569 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
571 <a id="Ext.menu.Menu-purgeListeners"></a>
\r
572 <b>purgeListeners</b>() : void <div class="mdesc">
\r
573 <div class="short">Removes all listeners for this object</div>
\r
575 Removes all listeners for this object <div class="mdetail-params">
\r
576 <strong>Parameters:</strong>
\r
577 <ul><li>None.</li> </ul>
\r
578 <strong>Returns:</strong>
\r
580 <li><code>void</code></li>
\r
586 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>
\r
588 <tr class="method-row inherited expandable">
\r
589 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
591 <a id="Ext.menu.Menu-relayEvents"></a>
\r
592 <b>relayEvents</b>( <code>Object o</code>, <code>Array events</code> ) : void <div class="mdesc">
\r
593 <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
\r
595 Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>. <div class="mdetail-params">
\r
596 <strong>Parameters:</strong>
\r
597 <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>
\r
598 <strong>Returns:</strong>
\r
600 <li><code>void</code></li>
\r
606 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>
\r
608 <tr class="method-row alt expandable">
\r
609 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
611 <a id="Ext.menu.Menu-remove"></a>
\r
612 <b>remove</b>( <code>Ext.menu.Item item</code> ) : void <div class="mdesc">
\r
613 <div class="short">Removes an <a ext:cls="Ext.menu.Item" href="output/Ext.menu.Item.html">Ext.menu.Item</a> from the menu and destroys the object</div>
\r
615 Removes an <a ext:cls="Ext.menu.Item" href="output/Ext.menu.Item.html">Ext.menu.Item</a> from the menu and destroys the object <div class="mdetail-params">
\r
616 <strong>Parameters:</strong>
\r
617 <ul><li><code>item</code> : Ext.menu.Item<div class="sub-desc">The menu item to remove</div></li> </ul>
\r
618 <strong>Returns:</strong>
\r
620 <li><code>void</code></li>
\r
626 <td class="msource">Menu</td>
\r
628 <tr class="method-row expandable">
\r
629 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
631 <a id="Ext.menu.Menu-removeAll"></a>
\r
632 <b>removeAll</b>() : void <div class="mdesc">
\r
633 <div class="short">Removes and destroys all items in the menu</div>
\r
635 Removes and destroys all items in the menu <div class="mdetail-params">
\r
636 <strong>Parameters:</strong>
\r
637 <ul><li>None.</li> </ul>
\r
638 <strong>Returns:</strong>
\r
640 <li><code>void</code></li>
\r
646 <td class="msource">Menu</td>
\r
648 <tr class="method-row inherited alt expandable">
\r
649 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
651 <a id="Ext.menu.Menu-removeListener"></a>
\r
652 <b>removeListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
653 <div class="short">Removes a listener</div>
\r
655 Removes a listener <div class="mdetail-params">
\r
656 <strong>Parameters:</strong>
\r
657 <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 handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
\r
658 <strong>Returns:</strong>
\r
660 <li><code>void</code></li>
\r
666 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>
\r
668 <tr class="method-row inherited expandable">
\r
669 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
671 <a id="Ext.menu.Menu-resumeEvents"></a>
\r
672 <b>resumeEvents</b>() : void <div class="mdesc">
\r
673 <div class="short">Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>)</div>
\r
675 Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>) <div class="mdetail-params">
\r
676 <strong>Parameters:</strong>
\r
677 <ul><li>None.</li> </ul>
\r
678 <strong>Returns:</strong>
\r
680 <li><code>void</code></li>
\r
686 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>
\r
688 <tr class="method-row alt expandable">
\r
689 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
691 <a id="Ext.menu.Menu-show"></a>
\r
692 <b>show</b>( <code>Mixed element</code>, <span class="optional" title="Optional">[<code>String position</code>]</span>, <span class="optional" title="Optional">[<code>Ext.menu.Menu parentMenu</code>]</span> ) : void <div class="mdesc">
\r
693 <div class="short">Displays this menu relative to another element</div>
\r
695 Displays this menu relative to another element <div class="mdetail-params">
\r
696 <strong>Parameters:</strong>
\r
697 <ul><li><code>element</code> : Mixed<div class="sub-desc">The element to align to</div></li><li><code>position</code> : String<div class="sub-desc">(optional) The <a ext:cls="Ext.Element" ext:member="alignTo" href="output/Ext.Element.html#alignTo">Ext.Element.alignTo</a> anchor position to use in aligning to
698 the element (defaults to this.defaultAlign)</div></li><li><code>parentMenu</code> : Ext.menu.Menu<div class="sub-desc">(optional) This menu's parent menu, if applicable (defaults to undefined)</div></li> </ul>
\r
699 <strong>Returns:</strong>
\r
701 <li><code>void</code></li>
\r
707 <td class="msource">Menu</td>
\r
709 <tr class="method-row expandable">
\r
710 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
712 <a id="Ext.menu.Menu-showAt"></a>
\r
713 <b>showAt</b>( <code>Array xyPosition</code>, <span class="optional" title="Optional">[<code>Ext.menu.Menu parentMenu</code>]</span> ) : void <div class="mdesc">
\r
714 <div class="short">Displays this menu at a specific xy position</div>
\r
716 Displays this menu at a specific xy position <div class="mdetail-params">
\r
717 <strong>Parameters:</strong>
\r
718 <ul><li><code>xyPosition</code> : Array<div class="sub-desc">Contains X & Y [x, y] values for the position at which to show the menu (coordinates are page-based)</div></li><li><code>parentMenu</code> : Ext.menu.Menu<div class="sub-desc">(optional) This menu's parent menu, if applicable (defaults to undefined)</div></li> </ul>
\r
719 <strong>Returns:</strong>
\r
721 <li><code>void</code></li>
\r
727 <td class="msource">Menu</td>
\r
729 <tr class="method-row inherited alt expandable">
\r
730 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
732 <a id="Ext.menu.Menu-suspendEvents"></a>
\r
733 <b>suspendEvents</b>() : void <div class="mdesc">
\r
734 <div class="short">Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>)</div>
\r
736 Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>) <div class="mdetail-params">
\r
737 <strong>Parameters:</strong>
\r
738 <ul><li>None.</li> </ul>
\r
739 <strong>Returns:</strong>
\r
741 <li><code>void</code></li>
\r
747 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>
\r
749 <tr class="method-row inherited expandable">
\r
750 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
752 <a id="Ext.menu.Menu-un"></a>
\r
753 <b>un</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
754 <div class="short">Removes a listener (shorthand for removeListener)</div>
\r
756 Removes a listener (shorthand for removeListener) <div class="mdetail-params">
\r
757 <strong>Parameters:</strong>
\r
758 <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 handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
\r
759 <strong>Returns:</strong>
\r
761 <li><code>void</code></li>
\r
767 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>
\r
770 <a id="Ext.menu.Menu-events"></a>
771 <h2>Public Events</h2>
772 <table cellspacing="0" class="member-table">
774 <th class="sig-header" colspan="2">Event</th>
775 <th class="msource-header">Defined By</th>
777 <tr class="event-row expandable">
\r
778 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
780 <a id="Ext.menu.Menu-beforehide"></a>
\r
781 <b>beforehide</b> : ( <code>Ext.menu.Menu this</code> ) <div class="mdesc">
\r
782 <div class="short">Fires before this menu is hidden</div>
\r
784 Fires before this menu is hidden <div class="mdetail-params">
\r
785 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
786 <ul><li><code>this</code> : Ext.menu.Menu<div class="sub-desc"></div></li> </ul>
\r
791 <td class="msource">Menu</td>
\r
793 <tr class="event-row alt expandable">
\r
794 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
796 <a id="Ext.menu.Menu-beforeshow"></a>
\r
797 <b>beforeshow</b> : ( <code>Ext.menu.Menu this</code> ) <div class="mdesc">
\r
798 <div class="short">Fires before this menu is displayed</div>
\r
800 Fires before this menu is displayed <div class="mdetail-params">
\r
801 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
802 <ul><li><code>this</code> : Ext.menu.Menu<div class="sub-desc"></div></li> </ul>
\r
807 <td class="msource">Menu</td>
\r
809 <tr class="event-row expandable">
\r
810 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
812 <a id="Ext.menu.Menu-click"></a>
\r
813 <b>click</b> : ( <code>Ext.menu.Menu this</code>, <code>Ext.menu.Item menuItem</code>, <code>Ext.EventObject e</code> ) <div class="mdesc">
\r
814 <div class="short">Fires when this menu is clicked (or when the enter key is pressed while it is active)</div>
\r
816 Fires when this menu is clicked (or when the enter key is pressed while it is active) <div class="mdetail-params">
\r
817 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
818 <ul><li><code>this</code> : Ext.menu.Menu<div class="sub-desc"></div></li><li><code>menuItem</code> : Ext.menu.Item<div class="sub-desc">The menu item that was clicked</div></li><li><code>e</code> : Ext.EventObject<div class="sub-desc"></div></li> </ul>
\r
823 <td class="msource">Menu</td>
\r
825 <tr class="event-row alt expandable">
\r
826 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
828 <a id="Ext.menu.Menu-hide"></a>
\r
829 <b>hide</b> : ( <code>Ext.menu.Menu this</code> ) <div class="mdesc">
\r
830 <div class="short">Fires after this menu is hidden</div>
\r
832 Fires after this menu is hidden <div class="mdetail-params">
\r
833 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
834 <ul><li><code>this</code> : Ext.menu.Menu<div class="sub-desc"></div></li> </ul>
\r
839 <td class="msource">Menu</td>
\r
841 <tr class="event-row expandable">
\r
842 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
844 <a id="Ext.menu.Menu-itemclick"></a>
\r
845 <b>itemclick</b> : ( <code>Ext.menu.BaseItem baseItem</code>, <code>Ext.EventObject e</code> ) <div class="mdesc">
\r
846 <div class="short">Fires when a menu item contained in this menu is clicked</div>
\r
848 Fires when a menu item contained in this menu is clicked <div class="mdetail-params">
\r
849 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
850 <ul><li><code>baseItem</code> : Ext.menu.BaseItem<div class="sub-desc">The BaseItem that was clicked</div></li><li><code>e</code> : Ext.EventObject<div class="sub-desc"></div></li> </ul>
\r
855 <td class="msource">Menu</td>
\r
857 <tr class="event-row alt expandable">
\r
858 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
860 <a id="Ext.menu.Menu-mouseout"></a>
\r
861 <b>mouseout</b> : ( <code>Ext.menu.Menu this</code>, <code>Ext.EventObject e</code>, <code>Ext.menu.Item menuItem</code> ) <div class="mdesc">
\r
862 <div class="short">Fires when the mouse exits this menu</div>
\r
864 Fires when the mouse exits this menu <div class="mdetail-params">
\r
865 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
866 <ul><li><code>this</code> : Ext.menu.Menu<div class="sub-desc"></div></li><li><code>e</code> : Ext.EventObject<div class="sub-desc"></div></li><li><code>menuItem</code> : Ext.menu.Item<div class="sub-desc">The menu item that was clicked</div></li> </ul>
\r
871 <td class="msource">Menu</td>
\r
873 <tr class="event-row expandable">
\r
874 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
876 <a id="Ext.menu.Menu-mouseover"></a>
\r
877 <b>mouseover</b> : ( <code>Ext.menu.Menu this</code>, <code>Ext.EventObject e</code>, <code>Ext.menu.Item menuItem</code> ) <div class="mdesc">
\r
878 <div class="short">Fires when the mouse is hovering over this menu</div>
\r
880 Fires when the mouse is hovering over this menu <div class="mdetail-params">
\r
881 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
882 <ul><li><code>this</code> : Ext.menu.Menu<div class="sub-desc"></div></li><li><code>e</code> : Ext.EventObject<div class="sub-desc"></div></li><li><code>menuItem</code> : Ext.menu.Item<div class="sub-desc">The menu item that was clicked</div></li> </ul>
\r
887 <td class="msource">Menu</td>
\r
889 <tr class="event-row alt expandable">
\r
890 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
892 <a id="Ext.menu.Menu-show"></a>
\r
893 <b>show</b> : ( <code>Ext.menu.Menu this</code> ) <div class="mdesc">
\r
894 <div class="short">Fires after this menu is displayed</div>
\r
896 Fires after this menu is displayed <div class="mdetail-params">
\r
897 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
898 <ul><li><code>this</code> : Ext.menu.Menu<div class="sub-desc"></div></li> </ul>
\r
903 <td class="msource">Menu</td>
\r