Hello, we have a drill down URL in one of our tabl...
# gooddata-ui
m
Hello, we have a drill down URL in one of our tables. These links work fine on the main GoodData dashboard. However, when embedded w/ React, the link shows as a link and the cursor changes to a "clicking hand" when hovering, but nothing happens when you click. Is there something we have to do to get the URLs to work when embedded?
i
Hello Michael, To add the drilling to your embedded analytics, you will need to specify at least one
drillableItem
. More details and examples can be found here.
m
Hey Ivana, I'm embedding a dashboard. Does that change things?
i
That shouldn't be an issue here, really. Please give it a chance a let me know how does it work for you.
m
OK, I see at the bottom of that page, it describes how to do this for dashboards. I'll try this. I feel compelled to say that this is confusing from a DX perspective: we specify drillable items as part of the dashboard itself... but we need to specify it again in React? Why?
k
I will say, from my own experience building a wrapper for the React embeds, it did feel confusing that Drill-to-URL didn't work out-of-the-box. However, it did enable me to create some funky workarounds for passing data onclick (e.g., if the URL starts with
data:
, don't navigate to the url, instead trigger an event and pass the url data along)
m
I'm still struggling on how to do this with the react
<Dashboard>
component. The directions I see are about adding an event listener for the "listeningForDrillableItems" event, and responding to that. However, I never see this event generated (no "gdc" events, period). I see plenty of other react events. Looking at the Typescript types for the dashboard component led me to add "enableKPIDashboardDrillToURL" as a prop, but it's still not working.
k
I used the <Dashboard>'s
eventHandlers
prop (takes
DashboardEventHandler<any>[]
). For drillToURL in particular,
{ eval: isDashboardDrillToCustomUrlResolved, handler: yourDrillToURLCallback }
. Pretty sure I just found that by sleuthing the code/types, too, though.
m
Thanks @Kayden. If anyone else finds this thread, this is what ended up working for me: