</script>
</head>
<body onload="prettyPrint(); highlight();">
- <pre class="prettyprint lang-js"><span id='Ext-button-Button-method-constructor'><span id='Ext-button-Button'>/**
-</span></span> * @class Ext.button.Button
+ <pre class="prettyprint lang-js"><span id='Ext-button-Button'>/**
+</span> * @class Ext.button.Button
* @extends Ext.Component
-Create simple buttons with this component. Customisations include {@link #config-iconAlign aligned}
-{@link #config-iconCls icons}, {@link #config-menu dropdown menus}, {@link #config-tooltip tooltips}
-and {@link #config-scale sizing options}. Specify a {@link #config-handler handler} to run code when
-a user clicks the button, or use {@link #config-listeners listeners} for other events such as
-{@link #events-mouseover mouseover}.
+Create simple buttons with this component. Customisations include {@link #iconAlign aligned}
+{@link #iconCls icons}, {@link #menu dropdown menus}, {@link #tooltip tooltips}
+and {@link #scale sizing options}. Specify a {@link #handler handler} to run code when
+a user clicks the button, or use {@link #listeners listeners} for other events such as
+{@link #mouseover mouseover}.
{@img Ext.button.Button/Ext.button.Button1.png Ext.button.Button component}
Example usage:
}
});
- * @constructor
- * Create a new button
- * @param {Object} config The config object
- * @xtype button
* @markdown
* @docauthor Robert Dougan <rob@sencha.com>
*/
'<em class="{splitCls}">' +
'<tpl if="href">' +
'<a href="{href}" target="{target}"<tpl if="tabIndex"> tabIndex="{tabIndex}"</tpl> role="link">' +
- '<span class="{baseCls}-inner">{text}</span>' +
+ '<span class="{baseCls}-inner">' +
+ '{text}' +
+ '</span>' +
+ '<span class="{baseCls}-icon"></span>' +
'</a>' +
'</tpl>' +
'<tpl if="!href">' +
// the autocomplete="off" is required to prevent Firefox from remembering
// the button's disabled state between page reloads.
'<tpl if="tabIndex"> tabIndex="{tabIndex}"</tpl> role="button" autocomplete="off">' +
- '<span class="{baseCls}-inner" style="{innerSpanStyle}">{text}</span>' +
+ '<span class="{baseCls}-inner" style="{innerSpanStyle}">' +
+ '{text}' +
+ '</span>' +
+ '<span class="{baseCls}-icon"></span>' +
'</button>' +
'</tpl>' +
'</em>' ,
Ext.applyIf(me.renderSelectors, {
btnEl : me.href ? 'a' : 'button',
btnWrap: 'em',
- btnInnerEl: '.' + me.baseCls + '-inner'
+ btnInnerEl: '.' + me.baseCls + '-inner',
+ btnIconEl: '.'+ me.baseCls + '-icon'
});
if (me.scale) {
*/
setIconCls: function(cls) {
var me = this,
- btnInnerEl = me.btnInnerEl;
- if (btnInnerEl) {
+ btnIconEl = me.btnIconEl;
+ if (btnIconEl) {
// Remove the previous iconCls from the button
- btnInnerEl.removeCls(me.iconCls);
- btnInnerEl.addCls(cls || '');
+ btnIconEl.removeCls(me.iconCls);
+ btnIconEl.addCls(cls || '');
me.setButtonCls();
}
me.iconCls = cls;