sapui5 - 将第一列标题以一定的宽度移动到每行

标签 sapui5

每当浏览器大小低于Desktop时宽度,我希望我的响应表隐藏列标题,并将它们放置在与每个条目的对应值相同的行中。

这是我想要的直观示例:

桌面宽度
Desktop width example

低于桌面宽度
Below desktop width example

在我看来,实现这种行为的方法是添加...

minScreenWidth="desktop"
demandPopin="true"

...至<Column>标记,但这不适用于第一列

所以我的问题是:如何(很好地)实现第一列的行为?

这是我的最小示例代码(我更改了 this exampleTable.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 visible sap.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/

相关文章:

sapui5 - 如何在 sapui5 中打开媒体源?

sapui5 - SAP UI5中DatePicker控件的验证

sapui5 - sap.ui.core.routing.Router.navTo() 和 sap.m.routing.Targets.display() 有什么区别?

sapui5 - 要将新图标添加到OpenUI5吗?

javascript - 具有静态控制的 SAPUI5 聚合绑定(bind)

javascript - SAPUI5模型加载

javascript - SAPUI5:如何在将数据推送到OData服务时显示加载对话框?

sapui5 - 从文档运行 UI5 示例应用程序

javascript - 在 sapui5 中点击下载 d3 图表

javascript - 使用 new Function() 和字符串创建 SAPUI5 控件