Fire off drillmenu:click event without redirecting to link

I noticed there was a similar question but no response so I’m asking myself.
Currently we have embedded dashboards in our Application we are firing off a drillmenu:click event and doing some additional logic in JS from there. I’m wanting to know if there is a way to get the event to fire off retrieve the associated url without having the iframe actually get redirected to that url. Here’s an example configuration for reference. Is there an option other than link that could help get me there maybe?

 

f56fbec3-ddf5-471a-98b8-fc6e962b27b1.png
0 2 169
2 REPLIES 2

👋hey @codyanderson91 ,
While working on Looker extension framework, I came across a functionality that we are implementing. That is to redirect a drillmenu:click event to open a drawer from the right side of the window, instead of opening a new tab. The code below shows how you can simple cancel the action of  "having the iframe actually get redirected to that url".

// ... rest of code
/**
 * A canceller callback can prevent the default behavior of links on a dashboard.
 * In this instance, if the click will navigate to a new window, the navigation is
 * cancelled.
 */
const preventNavigation = (event: any): any => {
  const { preventNavigation } = getConfiguration()
  if (preventNavigation) {
    updateStatus('#dashboard-state', `${event.label} clicked`)
    return { cancel: !event.modal }
  }
  return {}
}
// ... rest of code
.on('drillmenu:click', preventNavigation)
// ... rest of code

 source

This way you could execute your actions from the event being fired and have no new window/tab open with the LookML tag link.

Hope it helps

Thanks for responding to this. When I get a minute I will need to recreate this in my code and see if I get the desired results

Top Labels in this Space
Top Solution Authors