我是 extjs 的新手,只是停留在 hbox 设置中的动态(百分比)高度。
这是我的 extjs 代码
"xtype": "container",
"layout": "fit",
"width": "100%",
"height": "100%",
"cls": "dashboard-layout dashboard-layout-1-2",
"items": [
{
"xtype": "dashboardpanelcontainer",
"height": "45%"
},
{
"xtype": "container",
"layout": "fit",
"width": "100%",
"height": "45%",
"layout":
{
"type": "hbox",
"align": "stretch"
},
"items": [
{
"xtype": "dashboardpanelcontainer",
"flex": 1
},
{
"xtype": "ruban-dashboardpanelcontainer",
"flex": 1
}]
}]
这种代码和平工作正常并将高度设置为 45%
"xtype": "dashboardpanelcontainer",
"height": "45%"
第二项作为容器“xtype”:“container”也将高度设置为 45%,但 hbox 项目没有选择这 45%,hbox 项目的高度为 0px
我不能使用“xtype”:“window”或“xtype”:“viewport”需要在“xtype”中:“window”
任何帮助如何在我的情况下将容器 hbox 项目高度设置为百分比 45%。
如果我在 hbox 项目中添加样式,它也不起作用
"xtype": "dashboardpanelcontainer",
"flex": 1,
"style":
{
"height": "100%"
}
谢谢您的帮助