/ext-4.1.0_b3/examples/layout/vbox.html
HTML | 434 lines | 428 code | 5 blank | 1 comment | 0 complexity | ab55451900da01ed0fa41c70c805f4d5 MD5 | raw file
- <html>
- <head>
- <title>VBox Layout</title>
- <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
- <link rel="stylesheet" type="text/css" href="../shared/example.css" />
- <!-- GC -->
- <script type="text/javascript" src="../../ext-all.js"></script>
- <style type="text/css">
- html, body {
- font: normal 12px verdana;
- margin: 0;
- padding: 0;
- border: 0 none;
- }
- </style>
- <script type="text/javascript">
- Ext.onReady(function() {
- var currentName;
- var replace = function(config, name) {
- var btns = Ext.getCmp('btns');
- if (name && name != currentName) {
- currentName = name;
- btns.remove(0);
- btns.add(Ext.apply(config));
- }
- };
- var viewport = Ext.create('Ext.Viewport', {
- layout:'border',
- items: [{
- id:'btns',
- region:'west',
- baseCls:'x-plain',
- split:true,
- width:150,
- minWidth: 100,
- maxWidth: 250,
- layout:'fit',
- margins: '5 0 5 5',
- items: {
- baseCls: 'x-plain',
- html: '<p style="padding:10px;color:#556677;font-size:11px;">Select a configuration to the right »</p>'
- }
- }, {
- region:'center',
- margins: '5 5 5 0',
- layout: 'anchor',
- items:[{
- anchor: '100%',
- baseCls:'x-plain',
- layout: {
- type:'hbox',
- padding: 10
- },
- defaults:{
- margins:'0 5 0 0',
- pressed: false,
- toggleGroup:'btns',
- allowDepress: false
- },
- items: [{
- xtype:'button',
- text: 'Spaced / Align: left',
- handler: function(){
- replace({
- layout: {
- type:'vbox',
- padding:'5',
- align:'left'
- },
- defaults:{margins:'0 0 5 0'},
- items:[{
- xtype:'button',
- text: 'Button 1'
- },{
- xtype:'tbspacer',
- flex:1
- },{
- xtype:'button',
- text: 'Button 2'
- },{
- xtype:'button',
- text: 'Button 3'
- },{
- xtype:'button',
- text: 'Button 4',
- margins:'0'
- }]
- }, 'spaced');
- }
- },{
- xtype:'button',
- text: 'Multi-Spaced / Align: left',
- handler: function(){
- replace({
- layout: {
- type:'vbox',
- padding:'5',
- align:'left'
- },
- defaults:{margins:'0 0 5 0'},
- items:[{
- xtype:'button',
- text: 'Button 1'
- },{
- xtype:'tbspacer',
- flex:1
- },{
- xtype:'button',
- text: 'Button 2'
- },{
- xtype:'tbspacer',
- flex:1
- },{
- xtype:'button',
- text: 'Button 3'
- },{
- xtype:'tbspacer',
- flex:1
- },{
- xtype:'button',
- text: 'Button 4',
- margins:'0'
- }]
- }, 'multi spaced - align left');
- }
- },{
- xtype:'button',
- text: 'Align: left',
- handler: function(){
- replace({
- layout: {
- type:'vbox',
- padding:'5',
- align:'left'
- },
- defaults:{margins:'0 0 5 0'},
- items:[{
- xtype:'button',
- text: 'Button 1'
- },{
- xtype:'button',
- text: 'Button 2'
- },{
- xtype:'button',
- text: 'Button 3'
- },{
- xtype:'button',
- text: 'Button 4'
- }]
- }, 'align left');
- }
- },{
- xtype:'button',
- text: 'Align: center',
- handler: function(){
- replace({
- layout: {
- type:'vbox',
- padding:'5',
- align:'center'
- },
- defaults:{margins:'0 0 5 0'},
- items:[{
- xtype:'button',
- text: 'Button 1'
- },{
- xtype:'button',
- text: 'Button 2'
- },{
- xtype:'button',
- text: 'Button 3'
- },{
- xtype:'button',
- text: 'Button 4'
- }]
- }, 'align center');
- }
- },{
- xtype:'button',
- text: 'Align: stretch',
- handler: function(){
- replace({
- layout: {
- type:'vbox',
- padding:'5',
- align:'stretch'
- },
- defaults:{margins:'0 0 5 0'},
- items:[{
- xtype:'button',
- text: 'Button 1'
- },{
- xtype:'button',
- text: 'Button 2'
- },{
- xtype:'button',
- text: 'Button 3'
- },{
- xtype:'button',
- text: 'Button 4'
- }]
- }, 'align stretch');
- }
- },{
- xtype:'button',
- text: 'Align: stretchmax',
- handler: function(){
- replace({
- layout: {
- type:'vbox',
- padding:'5',
- align:'stretchmax'
- },
- defaults:{margins:'0 0 5 0'},
- items:[{
- xtype:'button',
- text: 'Jamie'
- },{
- xtype:'button',
- text: 'Aaron'
- },{
- xtype:'button',
- text: 'Tommy'
- },{
- xtype:'button',
- text: 'Ed '
- }]
- }, 'align stretchmax');
- }
- }]
- },{
- anchor: '100%',
- baseCls:'x-plain',
- layout: {
- type:'hbox',
- padding: '0 10 10'
- },
- defaults:{
- margins:'0 5 0 0',
- pressed: false,
- toggleGroup:'btns',
- allowDepress: false
-