Skip to Content
0
Aug 07, 2020 at 10:59 AM

smart table press on column and change view

90 Views

hi!

I have connected a smarttable via cds and odata and now I want to click on an entry in the smarttable so that a new view opens.
However, I do not know how to get the data.
I have found this here: https://answers.sap.com/questions/12946842/how-to-get-selected-item-from-a-smart-table-in-a-f.html

onButtonPress: function (oEvent) {
  var oSource = oEvent.getSource();
  var oContext = oSource.getParent().getParent().getTable().getSelectedContexts(); 
evt.getSource().getParent().getParent().getSelectedItems();

But I don't know where to use this code.

I still don't understand how I make a selection that opens a new view. How do I get the click on a cell and trigger something that opens a view?