以下ExtJSのコードは次のように、互いの左右に2つの領域を作成します。ExtJSテーブルレイアウトの2つの領域を一番上に揃える方法を教えてください。
を私は2つの領域がトップ整列するように、このコードを変更するには何がありますか?
<script type="text/javascript">
var template_topbottom_top = new Ext.Panel({
frame: false,
border: false,
header: false,
items: []
});
var template_topbottom_bottom = new Ext.Panel({
frame: false,
border: false,
header: false,
items: []
});
var template_topbottom = new Ext.Panel({
id:'template_topbottom',
baseCls:'x-plain',
renderTo: Ext.getBody(),
layout:'table',
layoutConfig: {columns:2},
defaults: {
frame:true,
style: 'margin: 10px 0 0 10px; vertical-align: top' //doesn't work
},
items:[{
width: 210,
height: 300,
frame: false,
border: true,
header: false,
items: [template_topbottom_top]
},{
width: 1210,
height: 200,
frame: false,
border: true,
header: false,
items: [template_topbottom_bottom]
}
]
});
replaceComponentContent(targetRegion, template_topbottom, true);
</script>
ヒント:コンポーネントをオーバーネストしています。 'template_topbottom'の' items'は、新しい 'items'を作成し、その配列の孤独なパネルとして置くのではなく、' template_topbottom_top'と 'template_topbottom_bottom'を直接参照する必要があります。また、アイテムに単一のコンポーネントが含まれている場合は、配列でラップする必要はありません。 –