每当浏览器大小低于Desktop
时宽度,我希望我的响应表隐藏列标题,并将它们放置在与每个条目的对应值相同的行中。
这是我想要的直观示例:
在我看来,实现这种行为的方法是添加...
minScreenWidth="desktop"
demandPopin="true"
...至<Column>
标记,但这不适用于第一列。
所以我的问题是:如何(很好地)实现第一列的行为?
这是我的最小示例代码(我更改了 this example 的 Table.view.xml
):
<Table items="{/ProductCollection}">
<columns>
<Column>
<Text text="Supplier" />
</Column>
</columns>
<ColumnListItem>
<Label text="{SupplierName}" />
</ColumnListItem>
</Table>
最佳答案
响应式表格不允许将所有列标题推送到项目。来自 API reference :
The
sap.m.Table
control requires at least one visiblesap.m.Column
in the columns aggregation, therefore applications must avoid configuring all columns to be shown in the pop-in. If such a conflict is detected, then the table prevents one column from moving to the pop-in.
您必须至少再添加一列,以便第一列弹出。
相关 GitHub 问题:https://github.com/SAP/openui5/issues/1396
关于sapui5 - 将第一列标题以一定的宽度移动到每行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61683527/