如何在列表报表SAP Fiori应用程序中获取智能表中的行选择?

问题描述 投票:0回答:2

我正在使用列表报告模板来实现 SAP Fiori 应用程序。桌子的类型是

sap.ui.table.Table

我添加了一个操作扩展来添加“下载”按钮,并将其

requiresSelection
值设置为
true
。但我无法获取表格选择。

我收到错误

“不支持的操作:sap.ui.table.Table#getSelectedIndices 不得 如果应用了选择插件,则被调用。”

对于以下声明:

var oTable = oEvent.getSource().getParent().getParent().getTable(); //获取智能表控件内的表 oTable.getSelectedIndices();

请帮忙。

sap-fiori sapui5
2个回答
1
投票

试试这个: 为了获得上述错误的选定索引

var oTable = oEvent.getSource().getParent().getParent().getTable();

oTable.getAggregations("plugins")[0].getSelectedIndices();


-1
投票

尝试:

oTable._getSelectionPlugin().getSelectedIndices()
© www.soinside.com 2019 - 2024. All rights reserved.