3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
7 Ext.onReady(function(){
9 // This function renders a block of buttons
10 function renderButtons(title){
12 Ext.getBody().createChild({tag: 'h2', html: title});
41 'Icon and Text (left)',
57 'Icon and Text (top)',
76 'Icon and Text (right)',
95 'Icon and Text (bottom)',
114 renderButtons('Normal Buttons');
116 ButtonPanel.override({
120 renderButtons('Toggle Buttons');
122 ButtonPanel.override({
123 enableToggle : undefined,
124 menu : {items: [{text:'Menu Item 1'},{text:'Menu Item 2'},{text:'Menu Item 3'}]}
127 renderButtons('Menu Buttons');
129 ButtonPanel.override({
131 defaultType: 'splitbutton'
134 renderButtons('Split Buttons');
136 ButtonPanel.override({
138 defaultType: 'button',
142 renderButtons('Menu Buttons (Arrow on bottom)');
144 ButtonPanel.override({
146 defaultType: 'splitbutton'
149 renderButtons('Split Buttons (Arrow on bottom)');
152 // Helper class for organizing the buttons
153 ButtonPanel = Ext.extend(Ext.Panel, {
155 defaultType: 'button',
158 renderTo : 'docbody',
166 constructor: function(desc, buttons){
167 // apply test configs
168 for(var i = 0, b; b = buttons[i]; i++){
170 b.enableToggle = this.enableToggle;
171 b.split = this.split;
172 b.arrowAlign = this.arrowAlign;
176 autoEl: {tag: 'h3', html: desc, style:"padding:15px 0 3px;"},
180 ButtonPanel.superclass.constructor.call(this, {