Peter_K
November 15, 2023, 7:12pm
1
Hi Retool team
Is it possible to access the click event's data in an event handler?
My case:
I've created a table with some clickable content (links in cells)
I would like to have an additional behaviour (navigation) when user clicks on an entire row (but not when user targets a clickable link)
I figured the best way would be to add a row-click event handler and in it check the event.target
and then conditionally navigate.
ScottR
November 15, 2023, 7:20pm
2
It depends on where you are trying to navigate? A new tab? Somewhere else?
I recommend the navigation behavior to be triggered when double-clicked the row, so user cannot navigate accidentally when clicking the link.
Or you can set Cell selection property to "Single" and set an event handler on Click cell and set the "only run when" to:
{{ !tableId.selectedCell.value.includes("https://") }}
Peter_K
November 16, 2023, 2:48pm
4
We do have a custom logic for navigation. At the end of the day I need to run a custom script conditionally.
Peter_K
November 16, 2023, 2:52pm
5
I think this might be a good example.
the "Test721" is a link. When user clicks the link - they should be navigated to linked Test721, if they click on the cell (but not the link they should be navigated on the row level (to entity represented by the row))