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?
On
sap.m.Table
you can addattachItemPress(oData?, fnFunction, oListener?)
andfnFunction
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.