webgui/www/extras/extjs/docs/output/Ext.Toolbar.Button.html

1005 lines
No EOL
56 KiB
HTML

<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Ext.Toolbar.Button</title>
<link rel="stylesheet" type="text/css" href="../resources/reset.css"/>
<link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="../resources/print.css" media="print">
<!-- GC -->
</head>
<body>
<div class="body-wrap">
<div class="top-tools">
<img src="../resources/print.gif" width="16" height="16" align="absmiddle">&nbsp;<a href="Ext.Toolbar.Button.html" target="_blank">Print Friendly</a><br/>
</div>
<h1>Class Ext.Toolbar.Button</h1>
<table cellspacing="0">
<tr><td class="label">Package:</td><td>Ext</td></tr>
<tr><td class="label">Class:</td><td>Toolbar.Button</td></tr>
<tr><td class="label">Extends:</td><td><a href="Ext.Button.html">Button</a></td></tr>
<tr><td class="label">Defined In:</td><td><a href="Toolbar.jss.html">Toolbar.js</a></td></tr>
</table>
<div class="description">
A button that renders into a toolbar. </div>
<br />
<a href="#properties">Properties</a>
&nbsp;&nbsp;-&nbsp;&nbsp;<a href="#methods">Methods</a>
&nbsp;&nbsp;-&nbsp;&nbsp;<a href="#events">Events</a>
&nbsp;&nbsp;-&nbsp;&nbsp;<a href="#configs">Config Options</a>
<hr />
<a name="properties"></a>
<h2>Public Properties</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Property</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#disabled">disabled</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#disabled">Button</a></td>
</tr>
<tr>
<td class="mdesc">Read-only. True if this button is disabled</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#hidden">hidden</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#hidden">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Read-only. True if this button is hidden</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#pressed">pressed</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#pressed">Button</a></td>
</tr>
<tr>
<td class="mdesc">Read-only. True if this button is pressed (only if enableToggle = true)</td>
</tr>
</table>
<a name="methods"></a>
<h2>Public Methods</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Method</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#Toolbar.Button">Toolbar.Button</a>(<code>Object config</code>)</td>
<td class="msource" rowspan="2">Toolbar.Button</td>
</tr>
<tr>
<td class="mdesc">Creates a new Button</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#addEvents">addEvents</a>(<code>Object object</code>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#addEvents">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Copies any events from the passed object onto this object if they do not already exist. The passed object
must also ...</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#addListener">addListener</a>(<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</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#addListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Appends an event handler to this component</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#destroy">destroy</a>() : void</td>
<td class="msource" rowspan="2">Toolbar.Button</td>
</tr>
<tr class="alt">
<td class="mdesc">Remove and destroy this button</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#disable">disable</a>() : void</td>
<td class="msource" rowspan="2">Toolbar.Button</td>
</tr>
<tr>
<td class="mdesc">Disable this item</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#enable">enable</a>() : void</td>
<td class="msource" rowspan="2">Toolbar.Button</td>
</tr>
<tr class="alt">
<td class="mdesc">Enable this item</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#fireEvent">fireEvent</a>(<code>String eventName</code>, <code>Object... args</code>) : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#fireEvent">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Fires the specified event with the passed parameters (minus the event name).</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#focus">focus</a>() : void</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#focus">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Focus the button</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getEl">getEl</a>() : Ext.Element</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#getEl">Button</a></td>
</tr>
<tr>
<td class="mdesc">Returns the button's underlying element</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getText">getText</a>() : String</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#getText">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Gets the text for this button</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#hasListener">hasListener</a>(<code>String eventName</code>) : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#hasListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Checks to see if this object is currently listening for a specified event</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#hide">hide</a>() : void</td>
<td class="msource" rowspan="2">Toolbar.Button</td>
</tr>
<tr class="alt">
<td class="mdesc">Hide this button</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#on">on</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object options</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#on">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Appends an event handler to this element (shorthand for addListener)</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#purgeListeners">purgeListeners</a>() : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#purgeListeners">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Removes all listeners for this object</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#removeListener">removeListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#removeListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Removes a listener</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setDisabled">setDisabled</a>(<code>Boolean enabled</code>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#setDisabled">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Convenience function for boolean enable/disable</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setHandler">setHandler</a>(<code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#setHandler">Button</a></td>
</tr>
<tr>
<td class="mdesc">Assigns this button's click handler</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setText">setText</a>(<code>String text</code>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#setText">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Sets this button's text</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setVisible">setVisible</a>(<code>Boolean visible</code>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#setVisible">Button</a></td>
</tr>
<tr>
<td class="mdesc">Convenience function for boolean show/hide</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#show">show</a>() : void</td>
<td class="msource" rowspan="2">Toolbar.Button</td>
</tr>
<tr class="alt">
<td class="mdesc">Show this button</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#toggle">toggle</a>(<span class="optional" title="Optional">[<code>Boolean state</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#toggle">Button</a></td>
</tr>
<tr>
<td class="mdesc">If a state it passed, it becomes the pressed state otherwise the current state is toggled.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#un">un</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="Ext.util.Observable.html#un">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Removes a listener (shorthand for removeListener)</td>
</tr>
</table>
<a name="events"></a>
<h2>Public Events</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Event</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-click">click</a> : (<code>Button this</code>, <code>EventObject e</code>)</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#event-click">Button</a></td>
</tr>
<tr>
<td class="mdesc">Fires when this button is clicked</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-mouseout">mouseout</a> : (<code>Button this</code>, <code>Event e</code>)</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#event-mouseout">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Fires when the mouse exits the button</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-mouseover">mouseover</a> : (<code>Button this</code>, <code>Event e</code>)</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#event-mouseover">Button</a></td>
</tr>
<tr>
<td class="mdesc">Fires when the mouse hovers over the button</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-toggle">toggle</a> : (<code>Button this</code>, <code>Boolean pressed</code>)</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#event-toggle">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Fires when the "pressed" state of this button changes (only if enableToggle = true)</td>
</tr>
</table>
<a name="configs"></a>
<h2>Config Options</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Config Options</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-disabled">disabled</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#disabled">Button</a></td>
</tr>
<tr>
<td class="mdesc">True to start disabled (defaults to false)</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-enableToggle">enableToggle</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#enableToggle">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">True to enable pressed/not pressed toggling (defaults to false)</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-handler">handler</a> : Function</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#handler">Button</a></td>
</tr>
<tr>
<td class="mdesc">A function called when the button is clicked (can be used instead of click event)</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-hidden">hidden</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#hidden">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">True to start hidden (defaults to false)</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-icon">icon</a> : String</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#icon">Button</a></td>
</tr>
<tr>
<td class="mdesc">The path to an image to display in the button (the image will be set as the background-image CSS property of the butt...</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-menu">menu</a> : Mixed</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#menu">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Standard menu attribute consisting of a reference to a menu object, a menu id or a menu config blob</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-menuAlign">menuAlign</a> : String</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#menuAlign">Button</a></td>
</tr>
<tr>
<td class="mdesc">The position to align the menu to (see <a href="Ext.Element.html#alignTo">Ext.Element.alignTo</a> for more details, defaults to 'tl-bl?').</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-minWidth">minWidth</a> : Number</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#minWidth">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">The minimum width for this button (used to give a set of buttons a common width)</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-pressed">pressed</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#pressed">Button</a></td>
</tr>
<tr>
<td class="mdesc">True to start pressed (only if enableToggle = true)</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-repeat">repeat</a> : Boolean/Object</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#repeat">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">True to repeat fire the click event while the mouse is down. This can also be an Ext.util.ClickRepeater config object...</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-scope">scope</a> : Object</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#scope">Button</a></td>
</tr>
<tr>
<td class="mdesc">The scope of the handler</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-text">text</a> : String</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#text">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">The button text</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-toggleGroup">toggleGroup</a> : String</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#toggleGroup">Button</a></td>
</tr>
<tr>
<td class="mdesc">The group this toggle button is a member of (only 1 per group can be pressed, only applies if enableToggle = true)</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-tooltip">tooltip</a> : String/Object</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#tooltip">Button</a></td>
</tr>
<tr class="alt">
<td class="mdesc">The tooltip for the button - can be a string or QuickTips config object</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config-tooltipType">tooltipType</a> : String</td>
<td class="msource" rowspan="2"><a href="Ext.Button.html#tooltipType">Button</a></td>
</tr>
<tr>
<td class="mdesc">The type of tooltip to use. Either "qtip" for QuickTips or "title" for title attribute.</td>
</tr>
</table>
<h2 class="mdetail-head">Property Details</h2>
<div class="detail-wrap">
<a name="disabled"></a>
<div class="mdetail">
<h3>disabled</i></h3>
<code>public Boolean disabled</code>
<div class="mdetail-desc">
Read-only. True if this button is disabled </div>
<div class="mdetail-def">This property is defined by <a href="Ext.Button.html#disabled">Button</a>.</div>
</div>
<a name="hidden"></a>
<div class="mdetail alt">
<h3>hidden</i></h3>
<code>public Boolean hidden</code>
<div class="mdetail-desc">
Read-only. True if this button is hidden </div>
<div class="mdetail-def">This property is defined by <a href="Ext.Button.html#hidden">Button</a>.</div>
</div>
<a name="pressed"></a>
<div class="mdetail">
<h3>pressed</i></h3>
<code>public Boolean pressed</code>
<div class="mdetail-desc">
Read-only. True if this button is pressed (only if enableToggle = true) </div>
<div class="mdetail-def">This property is defined by <a href="Ext.Button.html#pressed">Button</a>.</div>
</div>
</div>
<a name="Toolbar.Button"></a>
<h2 class="mdetail-head">Constructor Details</h2>
<div class="detail-wrap">
<div class="mdetail">
<h3>Toolbar.Button</i></h3>
<code>public function Toolbar.Button(<code>Object config</code>)</code>
<div class="mdetail-desc">
Creates a new Button <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>config</code> : Object<div class="sub-desc">A standard <a href="Ext.Button.html">Ext.Button</a> config object</div></li> </ul>
</div>
</div>
</div>
</div>
<h2 class="mdetail-head">Method Details</h2>
<div class="detail-wrap">
<a name="addEvents"></a>
<div class="mdetail">
<h3>addEvents</i></h3>
<code>public function addEvents(<code>Object object</code>)</code>
<div class="mdetail-desc">
Copies any events from the passed object onto this object if they do not already exist. The passed object
must also inherit from Observable for this method to have any effect.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>object</code> : Object<div class="sub-desc">The object from which to copy events</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#addEvents">Observable</a>.</div>
</div>
<a name="addListener"></a>
<div class="mdetail alt">
<h3>addListener</i></h3>
<code>public function addListener(<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>)</code>
<div class="mdetail-desc">
Appends an event handler to this component
<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 in which to execute the handler function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration properties. This may contain any of the following properties:<ul> <li>scope {Object} The scope in which to execute the handler function. The handler function's "this" context.</li> <li>delegate {String} A simple selector to filter the target or look for a descendant of the target</li> <li>stopEvent {Boolean} True to stop the event. That is stop propagation, and prevent the default action.</li> <li>preventDefault {Boolean} True to prevent the default action</li> <li>stopPropagation {Boolean} True to prevent event propagation</li> <li>normalized {Boolean} False to pass a browser event to the handler function instead of an Ext.EventObject</li> <li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li> <li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li> <li>buffer {Number} Causes the handler to be scheduled to run in an <a href="Ext.util.DelayedTask.html">Ext.util.DelayedTask</a> delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li> </ul> <p> <b>Combining Options</b><br> Using the options argument, it is possible to combine different types of listeners:<br> <br> A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)<div style="margin: 5px 20px 20px;"> Code: <pre><code>el.on('click', this.onClick, this, { single: true, delay: 100, stopEvent : true, forumId: 4 });</pre> <p> The method also allows for a single argument to be passed which is a config object containing properties which specify multiple handlers. <p> <b>Attaching multiple handlers in 1 call</b><br> Code: <pre><code>el.on({ 'click' : { fn: this.onClick scope: this, delay: 100 }, 'mouseover' : { fn: this.onMouseOver scope: this }, 'mouseout' : { fn: this.onMouseOut scope: this } });</pre> <p> Or a shorthand syntax:<br> Code: <pre><code>el.on({ 'click' : this.onClick, 'mouseover' : this.onMouseOver, 'mouseout' : this.onMouseOut scope: this });</pre></div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#addListener">Observable</a>.</div>
</div>
<a name="destroy"></a>
<div class="mdetail">
<h3>destroy</i></h3>
<code>public function destroy()</code>
<div class="mdetail-desc">
Remove and destroy this button
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by Toolbar.Button.</div>
</div>
<a name="disable"></a>
<div class="mdetail alt">
<h3>disable</i></h3>
<code>public function disable()</code>
<div class="mdetail-desc">
Disable this item
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by Toolbar.Button.</div>
</div>
<a name="enable"></a>
<div class="mdetail">
<h3>enable</i></h3>
<code>public function enable()</code>
<div class="mdetail-desc">
Enable this item
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by Toolbar.Button.</div>
</div>
<a name="fireEvent"></a>
<div class="mdetail alt">
<h3>fireEvent</i></h3>
<code>public function fireEvent(<code>String eventName</code>, <code>Object... args</code>)</code>
<div class="mdetail-desc">
Fires the specified event with the passed parameters (minus the event name).
<div class="mdetail-params">
<strong>Parameters:</strong>
<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>
<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 class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#fireEvent">Observable</a>.</div>
</div>
<a name="focus"></a>
<div class="mdetail">
<h3>focus</i></h3>
<code>public function focus()</code>
<div class="mdetail-desc">
Focus the button
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.Button.html#focus">Button</a>.</div>
</div>
<a name="getEl"></a>
<div class="mdetail alt">
<h3>getEl</i></h3>
<code>public function getEl()</code>
<div class="mdetail-desc">
Returns the button's underlying element
<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">The element</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.Button.html#getEl">Button</a>.</div>
</div>
<a name="getText"></a>
<div class="mdetail">
<h3>getText</i></h3>
<code>public function getText()</code>
<div class="mdetail-desc">
Gets the text for this button
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>String</code><div class="sub-desc">The button text</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.Button.html#getText">Button</a>.</div>
</div>
<a name="hasListener"></a>
<div class="mdetail alt">
<h3>hasListener</i></h3>
<code>public function hasListener(<code>String eventName</code>)</code>
<div class="mdetail-desc">
Checks to see if this object is currently listening 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 class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#hasListener">Observable</a>.</div>
</div>
<a name="hide"></a>
<div class="mdetail">
<h3>hide</i></h3>
<code>public function hide()</code>
<div class="mdetail-desc">
Hide this button
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by Toolbar.Button.</div>
</div>
<a name="on"></a>
<div class="mdetail alt">
<h3>on</i></h3>
<code>public function on(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object options</code>]</span>)</code>
<div class="mdetail-desc">
Appends an event handler to this element (shorthand for addListener)
<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>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#on">Observable</a>.</div>
</div>
<a name="purgeListeners"></a>
<div class="mdetail">
<h3>purgeListeners</i></h3>
<code>public function purgeListeners()</code>
<div class="mdetail-desc">
Removes all listeners for this object
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#purgeListeners">Observable</a>.</div>
</div>
<a name="removeListener"></a>
<div class="mdetail alt">
<h3>removeListener</i></h3>
<code>public function removeListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>)</code>
<div class="mdetail-desc">
Removes a listener
<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 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>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#removeListener">Observable</a>.</div>
</div>
<a name="setDisabled"></a>
<div class="mdetail">
<h3>setDisabled</i></h3>
<code>public function setDisabled(<code>Boolean enabled</code>)</code>
<div class="mdetail-desc">
Convenience function for boolean enable/disable
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>enabled</code> : Boolean<div class="sub-desc">True to enable, false to disable</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.Button.html#setDisabled">Button</a>.</div>
</div>
<a name="setHandler"></a>
<div class="mdetail alt">
<h3>setHandler</i></h3>
<code>public function setHandler(<code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>)</code>
<div class="mdetail-desc">
Assigns this button's click handler
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>handler</code> : Function<div class="sub-desc">The function to call when the button is clicked</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) Scope for the function passed in</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.Button.html#setHandler">Button</a>.</div>
</div>
<a name="setText"></a>
<div class="mdetail">
<h3>setText</i></h3>
<code>public function setText(<code>String text</code>)</code>
<div class="mdetail-desc">
Sets this button's text
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>text</code> : String<div class="sub-desc">The button text</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.Button.html#setText">Button</a>.</div>
</div>
<a name="setVisible"></a>
<div class="mdetail alt">
<h3>setVisible</i></h3>
<code>public function setVisible(<code>Boolean visible</code>)</code>
<div class="mdetail-desc">
Convenience function for boolean show/hide
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>visible</code> : Boolean<div class="sub-desc">True to show, false to hide</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.Button.html#setVisible">Button</a>.</div>
</div>
<a name="show"></a>
<div class="mdetail">
<h3>show</i></h3>
<code>public function show()</code>
<div class="mdetail-desc">
Show this button
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by Toolbar.Button.</div>
</div>
<a name="toggle"></a>
<div class="mdetail alt">
<h3>toggle</i></h3>
<code>public function toggle(<span class="optional" title="Optional">[<code>Boolean state</code>]</span>)</code>
<div class="mdetail-desc">
If a state it passed, it becomes the pressed state otherwise the current state is toggled.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>state</code> : Boolean<div class="sub-desc">(optional) Force a particular state</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.Button.html#toggle">Button</a>.</div>
</div>
<a name="un"></a>
<div class="mdetail">
<h3>un</i></h3>
<code>public function un(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>)</code>
<div class="mdetail-desc">
Removes a listener (shorthand for removeListener)
<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 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>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="Ext.util.Observable.html#un">Observable</a>.</div>
</div>
</div>
<h2 class="mdetail-head">Event Details</h2>
<div class="detail-wrap">
<a name="event-click"></a>
<div class="mdetail">
<h3>click</i></h3>
<code>public event click</code>
<div class="mdetail-desc">
Fires when this button is clicked
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>this</code> : Button<div class="sub-desc"></div></li><li><code>e</code> : EventObject<div class="sub-desc">The click event</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="Ext.Button.html#event-click">Button</a>.</div>
</div>
<a name="event-mouseout"></a>
<div class="mdetail alt">
<h3>mouseout</i></h3>
<code>public event mouseout</code>
<div class="mdetail-desc">
Fires when the mouse exits the button
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>this</code> : Button<div class="sub-desc"></div></li><li><code>e</code> : Event<div class="sub-desc">The event object</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="Ext.Button.html#event-mouseout">Button</a>.</div>
</div>
<a name="event-mouseover"></a>
<div class="mdetail">
<h3>mouseover</i></h3>
<code>public event mouseover</code>
<div class="mdetail-desc">
Fires when the mouse hovers over the button
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>this</code> : Button<div class="sub-desc"></div></li><li><code>e</code> : Event<div class="sub-desc">The event object</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="Ext.Button.html#event-mouseover">Button</a>.</div>
</div>
<a name="event-toggle"></a>
<div class="mdetail alt">
<h3>toggle</i></h3>
<code>public event toggle</code>
<div class="mdetail-desc">
Fires when the "pressed" state of this button changes (only if enableToggle = true)
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>this</code> : Button<div class="sub-desc"></div></li><li><code>pressed</code> : Boolean<div class="sub-desc"></div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="Ext.Button.html#event-toggle">Button</a>.</div>
</div>
</div>
<h2 class="mdetail-head">Config Details</h2>
<div class="detail-wrap">
<a name="config-disabled"></a>
<div class="mdetail">
<h3>disabled</i></h3>
<code>disabled : Boolean</code>
<div class="mdetail-desc">
True to start disabled (defaults to false) </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#disabled">Button</a>.</div>
</div>
<a name="config-enableToggle"></a>
<div class="mdetail alt">
<h3>enableToggle</i></h3>
<code>enableToggle : Boolean</code>
<div class="mdetail-desc">
True to enable pressed/not pressed toggling (defaults to false) </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#enableToggle">Button</a>.</div>
</div>
<a name="config-handler"></a>
<div class="mdetail">
<h3>handler</i></h3>
<code>handler : Function</code>
<div class="mdetail-desc">
A function called when the button is clicked (can be used instead of click event) </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#handler">Button</a>.</div>
</div>
<a name="config-hidden"></a>
<div class="mdetail alt">
<h3>hidden</i></h3>
<code>hidden : Boolean</code>
<div class="mdetail-desc">
True to start hidden (defaults to false) </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#hidden">Button</a>.</div>
</div>
<a name="config-icon"></a>
<div class="mdetail">
<h3>icon</i></h3>
<code>icon : String</code>
<div class="mdetail-desc">
The path to an image to display in the button (the image will be set as the background-image CSS property of the button by default, so if you want a mixed icon/text button, set cls:"x-btn-text-icon") </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#icon">Button</a>.</div>
</div>
<a name="config-menu"></a>
<div class="mdetail alt">
<h3>menu</i></h3>
<code>menu : Mixed</code>
<div class="mdetail-desc">
Standard menu attribute consisting of a reference to a menu object, a menu id or a menu config blob </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#menu">Button</a>.</div>
</div>
<a name="config-menuAlign"></a>
<div class="mdetail">
<h3>menuAlign</i></h3>
<code>menuAlign : String</code>
<div class="mdetail-desc">
The position to align the menu to (see <a href="Ext.Element.html#alignTo">Ext.Element.alignTo</a> for more details, defaults to 'tl-bl?'). </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#menuAlign">Button</a>.</div>
</div>
<a name="config-minWidth"></a>
<div class="mdetail alt">
<h3>minWidth</i></h3>
<code>minWidth : Number</code>
<div class="mdetail-desc">
The minimum width for this button (used to give a set of buttons a common width) </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#minWidth">Button</a>.</div>
</div>
<a name="config-pressed"></a>
<div class="mdetail">
<h3>pressed</i></h3>
<code>pressed : Boolean</code>
<div class="mdetail-desc">
True to start pressed (only if enableToggle = true) </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#pressed">Button</a>.</div>
</div>
<a name="config-repeat"></a>
<div class="mdetail alt">
<h3>repeat</i></h3>
<code>repeat : Boolean/Object</code>
<div class="mdetail-desc">
True to repeat fire the click event while the mouse is down. This can also be an <a href="Ext.util.ClickRepeater.html">Ext.util.ClickRepeater</a> config object (defaults to false). </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#repeat">Button</a>.</div>
</div>
<a name="config-scope"></a>
<div class="mdetail">
<h3>scope</i></h3>
<code>scope : Object</code>
<div class="mdetail-desc">
The scope of the handler </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#scope">Button</a>.</div>
</div>
<a name="config-text"></a>
<div class="mdetail alt">
<h3>text</i></h3>
<code>text : String</code>
<div class="mdetail-desc">
The button text </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#text">Button</a>.</div>
</div>
<a name="config-toggleGroup"></a>
<div class="mdetail">
<h3>toggleGroup</i></h3>
<code>toggleGroup : String</code>
<div class="mdetail-desc">
The group this toggle button is a member of (only 1 per group can be pressed, only applies if enableToggle = true) </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#toggleGroup">Button</a>.</div>
</div>
<a name="config-tooltip"></a>
<div class="mdetail alt">
<h3>tooltip</i></h3>
<code>tooltip : String/Object</code>
<div class="mdetail-desc">
The tooltip for the button - can be a string or QuickTips config object </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#tooltip">Button</a>.</div>
</div>
<a name="config-tooltipType"></a>
<div class="mdetail">
<h3>tooltipType</i></h3>
<code>tooltipType : String</code>
<div class="mdetail-desc">
The type of tooltip to use. Either "qtip" for QuickTips or "title" for title attribute. </div>
<div class="mdetail-def">This config option is defined by <a href="Ext.Button.html#tooltipType">Button</a>.</div>
</div>
</div>
</div>
<hr>
<div style="font-size:10px;text-align:center;color:gray;">Ext - Copyright &copy; 2006-2007 Ext JS, LLC<br />All rights reserved.</div>
</body>
</html>