UI5 sap.m.Table itemPress 事件 [英] UI5 sap.m.Table itemPress event

查看:56
本文介绍了UI5 sap.m.Table itemPress 事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 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.

Fires when an item is pressed unless the item's type property is 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 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆