Smart Table, onclick event

2019-09-14 03:22发布

Is it possible to handle an onclick event on a Smart Table? I have annotated data coming from my backend. When clicking on an entry, I want to navigate to a new view displaying all data associated with the entry I clicked on.

How can I archive this in UI5? I can get the internal table with getTable in my JavaScript Controller, but how do I proceed?

标签: sapui5
1条回答
混吃等死
2楼-- · 2019-09-14 04:11

On sap.m.Table you can add attachItemPress(oData?, fnFunction, oListener?) and fnFunction will be called to handle the item press.

Because you are trying to use a SmartTable, you need to take into account the TableType. This will really determine the means to handle the 'click'.

Check the tableType of your smartTable and then follow the api reference for that table. If the tableType is sap.ui.comp.smarttable.TableType.ResponsiveTable, then the above should work.

查看更多
登录 后发表回答