Accessing row clicks in data table in modal



I'm drawing a data table using the DT package inside a modal. This is great for my UI, but I want users to be able to click it and access which row they clicked. The usual input$tablename_rows_clicked won't work, because it isn't given a slot in the UI.

Is there a clever DT type way of doing this? Or is there maybe a clever JavaScript way? Anyone any suggestions?