我正在 SAPui5 中开发一张表,并且在一个单元格中有 1 列和 2 个数据(产品名称和公司)。我使用 multiLables 选项来显示标题,但我需要为每个标题提供一个排序功能。那可能吗?
这是我的代码:
//Create an instance of the table control
var oTable2 = new sap.ui.table.Table('table1',{
visibleRowCount: 12,
selectionMode: sap.ui.table.SelectionMode.Single,
navigationMode: sap.ui.table.NavigationMode.Paginator,
editable: false,
});
//Define the columns and the control templates to be used
oTable2.addColumn(new sap.ui.table.Column('colkag', {
visible: false,
label: new sap.ui.commons.Label({text: "kag"}),
template: "kag",
sortProperty: "kag",
filterProperty: "kag",
}));
oTable2.addColumn(new sap.ui.table.Column('colname', {
multiLabels: [
new sap.ui.commons.Label({text: "Fondsname"}),
new sap.ui.commons.Label({text: "Verwaltungsgesellschaft"}) ],
template: new sap.m.ObjectIdentifier({title:"{name}", text:"{kag}"}),
sortProperty: "name",
filterProperty: "name",
width: "400px"
}));
这是结果: