1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-container.ButtonGroup-method-constructor'><span id='Ext-container.ButtonGroup'>/**
2 </span></span> * @class Ext.container.ButtonGroup
3 * @extends Ext.panel.Panel
4 * <p>Provides a container for arranging a group of related Buttons in a tabular manner.</p>
6 * {@img Ext.container.ButtonGroup/Ext.container.ButtonGroup.png Ext.container.ButtonGroup component}
7 * <pre><code>
8 Ext.create('Ext.panel.Panel', {
9 title: 'Panel with ButtonGroup',
12 renderTo: document.body,
13 html: 'HTML Panel Content',
33 menu: [{text: 'Menu Item 1'}]
35 xtype:'splitbutton', text: 'Cut', iconCls: 'add16', menu: [{text: 'Cut Menu Item'}]
37 text: 'Copy', iconCls: 'add16'
39 text: 'Format', iconCls: 'add16'
43 * </code></pre>
45 * Create a new ButtonGroup.
46 * @param {Object} config The config object
49 Ext.define('Ext.container.ButtonGroup', {
50 extend: 'Ext.panel.Panel',
51 alias: 'widget.buttongroup',
52 alternateClassName: 'Ext.ButtonGroup',
54 <span id='Ext-container.ButtonGroup-cfg-columns'> /**
55 </span> * @cfg {Number} columns The <tt>columns</tt> configuration property passed to the
56 * {@link #layout configured layout manager}. See {@link Ext.layout.container.Table#columns}.
59 <span id='Ext-container.ButtonGroup-cfg-baseCls'> /**
60 </span> * @cfg {String} baseCls Defaults to <tt>'x-btn-group'</tt>. See {@link Ext.panel.Panel#baseCls}.
62 baseCls: Ext.baseCSSPrefix + 'btn-group',
64 <span id='Ext-container.ButtonGroup-cfg-layout'> /**
65 </span> * @cfg {Object} layout Defaults to <tt>'table'</tt>. See {@link Ext.container.Container#layout}.
71 defaultType: 'button',
73 <span id='Ext-container.ButtonGroup-cfg-frame'> /**
74 </span> * @cfg {Boolean} frame Defaults to <tt>true</tt>. See {@link Ext.panel.Panel#frame}.
80 internalDefaults: {removeMode: 'container', hideParent: true},
82 initComponent : function(){
83 // Copy the component's columns config to the layout if specified
87 me.noTitleCls = me.baseCls + '-notitle';
89 me.layout = Ext.apply({}, {columns: cols}, me.layout);
93 me.addCls(me.noTitleCls);
95 me.callParent(arguments);
98 afterLayout: function() {
101 me.callParent(arguments);
103 // Pugly hack for a pugly browser:
104 // If not an explicitly set width, then size the width to match the inner table
105 if (me.layout.table && (Ext.isIEQuirks || Ext.isIE6) && !me.width) {
106 var t = me.getTargetEl();
107 t.setWidth(me.layout.table.offsetWidth + t.getPadding('lr'));
111 afterRender: function() {
114 //we need to add an addition item in here so the ButtonGroup title is centered
116 me.header.insert(0, {
124 me.callParent(arguments);
128 onBeforeAdd: function(component) {
129 if (component.is('button')) {
130 component.ui = component.ui + '-toolbar';
132 this.callParent(arguments);
136 applyDefaults: function(c) {
137 if (!Ext.isString(c)) {
138 c = this.callParent(arguments);
139 var d = this.internalDefaults;
141 Ext.applyIf(c.initialConfig, d);
150 <span id='Ext-container.ButtonGroup-cfg-tools'> /**
151 </span> * @cfg {Array} tools @hide
153 <span id='Ext-container.ButtonGroup-cfg-collapsible'> /**
154 </span> * @cfg {Boolean} collapsible @hide
156 <span id='Ext-container.ButtonGroup-cfg-collapseMode'> /**
157 </span> * @cfg {Boolean} collapseMode @hide
159 <span id='Ext-container.ButtonGroup-cfg-animCollapse'> /**
160 </span> * @cfg {Boolean} animCollapse @hide
162 <span id='Ext-container.ButtonGroup-cfg-closable'> /**
163 </span> * @cfg {Boolean} closable @hide
166 </pre></pre></body></html>