私は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%"
コンテナーとしての 2 番目のアイテム "xtype": "container" も高さを 45% に設定していますが、hbox アイテムはこの 45% を選択していません。hbox アイテムの高さは 0px です。
"xtype": "window" または "xtype": "viewport" は "xtype": "window" 内にある必要があります。
私の場合、コンテナのhboxアイテムの高さをパーセンテージで設定する方法は45%です。
hboxアイテムにスタイルを追加すると、それも機能しません
"xtype": "dashboardpanelcontainer",
"flex": 1,
"style":
{
"height": "100%"
}
助けてくれてありがとう