【发布时间】:2020-04-05 00:41:29
【问题描述】:
我有一个像下面这样的现有布局,其中每个框都是 D3 图表
================================
|
box 1 | box 2
|
|
================================
|
|
box 3 | box 4
|
|
我想安排方框 1,使其上方有 2 个按钮用于切换图表。
=============
button|button
box 1
所以完整的布局应该是这样的
================================
|
button|button | box 2
box 1 |
|
================================
|
|
box 3 | box 4
|
|
现有布局的代码如下
{
xtype: 'container',
layout: {
type: 'hbox',
align: 'stretch',
pack: 'start'
},
flex: 1,
padding: 5,
defaults: {
viewId: me.viewId,
frame: true,
height: 350,
cls: 'app-panel'
},
items: [
{xtype:'panel', itemId: 'box-1'},
{xtype:'panel', itemId: 'box-2'},
{xtype:'panel', itemId: 'box-3'},
{xtype:'panel', itemId: 'box-4'}
]}
所以我需要用某种父面板或容器替换第一个面板(itemId:'box-1')。我很难做到这一点。我怎样才能让 2 个按钮排成一行,然后在它下面放一个盒子?
【问题讨论】:
-
您从布局开始,但在获得 4 个面板后似乎停止了。我已经回答了下面的问题。