问题描述
我有一个 sap.m.Table,我正在尝试获取行信息.
I have a sap.m.Table and I m trying to get the row information.
这是我的 view.xml 表声明:
Here is my view.xml Table declaration:
<Table xmlns="sap.m" id="potiemsTable" inset="false" mode="MultiSelect" itemPress="rowSelectionChanged" >
在控制器中我尝试了一切......但仍然没有运气......
And in the Controller I tried everything...But still no luck...
rowSelectionChanged: function(oControlEvent)
{
var selectedRowContext = oControlEvent.getParameter("items");
var link = oControlEvent.getSource().getBindingContext();
var fr = oControlEvent.getBindingContext();
var ctx = oControlEvent.getBindingContext();
sap.m.alert(selectedRowContext);
},
该表使用 bindAggregation 通过提供的 OData 服务检索行.
The table uses bindAggregation to retrieve the rows through the provided OData service.
oTable.bindItems("/purchaseOrderSet(1)/purchaseItems",template);
谁能告诉我如何获取被点击行的上下文信息?
Can someone tell me how to retrieve the context information of the clicked row?
干杯!
乔治亚斯
推荐答案
请参阅 itemPress
事件的 API 文档:
Please see the API documentation of itemPress
event:
当项目被按下时触发,除非项目的 type
属性是 Inactive
.
请确保您的 ColumnListItems 确实具有 type 属性而不是 Inactive
,因为 Inactive
是默认值.
Please make it sure your ColumnListItems do have the type property rather than Inactive
since Inactive
is default value.
这篇关于UI5 sap.m.Table itemPress 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!