2 * @example Floating Panel
4 * Demonstrates some commonly used features of floating components
6 Ext.require('Ext.tab.Panel');
7 Ext.require('Ext.window.MessageBox');
9 Ext.onReady(function() {
11 var panel = Ext.create('Ext.panel.Panel', {
20 Ext.create('Ext.button.Button', {
21 renderTo: Ext.getBody(),
25 panel.show(); // show the panel
29 Ext.create('Ext.button.Button', {
30 renderTo: Ext.getBody(),
34 panel.hide(); // hide the panel
38 Ext.create('Ext.button.Button', {
39 renderTo: Ext.getBody(),
41 text: 'Align Panel to this button',
43 // align the top left corner of the panel to the bottom right corner
44 // of this button, offset by 3 pixels in each direction
45 panel.alignTo(this.getEl(), 'tl-br', [3, 3]);
49 Ext.create('Ext.button.Button', {
50 renderTo: Ext.getBody(),
54 panel.center(); // center the panel