Reputation: 318
I have a page with 3 elements created on the page and a 4th element (D) being loaded from a different script file using #parse. What I want to do is to force table layout to align them like this
____ ___
| A | |
|____| |
| B | D |
|____| |
| C | |
|____|___|
Is it possible? If yes, how?
I tried using colspan and rowspan to no avail.
Upvotes: 0
Views: 132
Reputation: 1592
You can do this by using layout specifically by using flex.
Example Code:
Ext.application({
name: 'Fiddle',
launch: function () {
Ext.Viewport.add({
xtype: 'panel',
title: 'Flexbox Layout Example',
items: [{
xtype: 'panel',
layout: {
type: 'hbox',
pack: 'start',
align: 'stretch'
},
height: '100%',
border: 1,
items: [{
xtype: 'panel',
flex: 1,
layout: {
type: 'vbox',
pack: 'start',
align: 'stretch'
},
items: [{
xtype: 'panel',
flex: 1,
html: 'Panel 1',
border: 1,
}, {
xtype: 'panel',
flex: 1,
html: 'Panel 2',
border: 1,
}, {
xtype: 'panel',
flex: 1,
html: 'panel 3',
border: 1,
}]
}, {
html: 'panel D',
xtype: 'panel',
flex: 1,
border: 1,
}]
}]
});
}
});
Link to working fiddle: https://fiddle.sencha.com/#view/editor&fiddle/2nio
Upvotes: 1