3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js"><div id="cls-Ext.ButtonGroup"></div>/**
\r
10 * @class Ext.ButtonGroup
\r
11 * @extends Ext.Panel
\r
12 * Container for a group of buttons. Example usage:
\r
14 var p = new Ext.Panel({
\r
15 title: 'Panel with Button Group',
\r
18 renderTo: document.body,
\r
21 xtype: 'buttongroup',
\r
22 {@link #columns}: 3,
\r
27 rowspan: 3, iconCls: 'add',
\r
29 cls: 'x-btn-as-arrow'
\r
31 xtype:'splitbutton',
\r
32 text: 'Menu Button',
\r
37 arrowAlign:'bottom',
\r
38 menu: [{text: 'Menu Item 1'}]
\r
40 xtype:'splitbutton', text: 'Cut', iconCls: 'add16', menu: [{text: 'Cut Menu Item'}]
\r
42 text: 'Copy', iconCls: 'add16'
\r
44 text: 'Format', iconCls: 'add16'
\r
50 * Create a new ButtonGroup.
\r
51 * @param {Object} config The config object
\r
52 * @xtype buttongroup
\r
54 Ext.ButtonGroup = Ext.extend(Ext.Panel, {
\r
55 <div id="cfg-Ext.ButtonGroup-columns"></div>/**
\r
56 * @cfg {Number} columns The <tt>columns</tt> configuration property passed to the
\r
57 * {@link #layout configured layout manager}. See {@link Ext.layout.TableLayout#columns}.
\r
59 <div id="cfg-Ext.ButtonGroup-baseCls"></div>/**
\r
60 * @cfg {String} baseCls Defaults to <tt>'x-btn-group'</tt>. See {@link Ext.Panel#baseCls}.
\r
62 baseCls: 'x-btn-group',
\r
63 <div id="cfg-Ext.ButtonGroup-layout"></div>/**
\r
64 * @cfg {String} layout Defaults to <tt>'table'</tt>. See {@link Ext.Container#layout}.
\r
67 defaultType: 'button',
\r
68 <div id="cfg-Ext.ButtonGroup-frame"></div>/**
\r
69 * @cfg {Boolean} frame Defaults to <tt>true</tt>. See {@link Ext.Panel#frame}.
\r
72 internalDefaults: {removeMode: 'container', hideParent: true},
\r
74 initComponent : function(){
\r
75 this.layoutConfig = this.layoutConfig || {};
\r
76 Ext.applyIf(this.layoutConfig, {
\r
77 columns : this.columns
\r
80 this.addClass('x-btn-group-notitle');
\r
82 this.on('afterlayout', this.onAfterLayout, this);
\r
83 Ext.ButtonGroup.superclass.initComponent.call(this);
\r
86 applyDefaults : function(c){
\r
87 c = Ext.ButtonGroup.superclass.applyDefaults.call(this, c);
\r
88 var d = this.internalDefaults;
\r
90 Ext.applyIf(c.initialConfig, d);
\r
98 onAfterLayout : function(){
\r
99 var bodyWidth = this.body.getFrameWidth('lr') + this.body.dom.firstChild.offsetWidth;
\r
100 this.body.setWidth(bodyWidth);
\r
101 this.el.setWidth(bodyWidth + this.getFrameWidth());
\r
103 <div id="cfg-Ext.ButtonGroup-tools"></div>/**
\r
104 * @cfg {Array} tools @hide
\r
108 Ext.reg('buttongroup', Ext.ButtonGroup);
\r