这里我选择了第二行和第五行,在突出显示的部分中我还有一个名为“发送请求”的按钮。如果我单击此按钮,它会调用在应用程序扩展中定义的 JavaScript Controller 函数。在此 js 函数中,如何检索所选的选定行?
我通过提及此代码启用了此页面中的复选框
manifest.json 中的"settings": { "gridTable": false, "multiSelect": true }
正如此链接推荐的那样https://sapui5.netweaver.ondemand.com/#docs/guide/116b5d82e8c545e2a56e1b51b8b0a9bd.html
我想知道如何检索已选择的行?
最佳答案
有一个 API 可用于您的用例。此处描述:https://sapui5.netweaver.ondemand.com/#docs/guide/bd2994b69ef542998becbc69ab093f7e.html
基本上,您只需要调用 getSelectedContexts方法。不幸的是,您将无法真正获取项目本身,只能获取绑定(bind)上下文(指向所选的数据实体)。文档摘录:
After you have defined a view extension, you can access and modify the properties of all UI elements defined within these extensions (for example, change the visibility). However, you cannot access any UI elements that are not defined within your view extensions.
关于sapui5 - 如何检索智能模板列表报表页面中选中的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42789042/