Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
embedded dashboards: send message to parent HTML doc when params change #7817
embedded dashboards: send message to parent HTML doc when params change
for #7811. this lets HTML pages that embed Metabase dashboards detect and handle when the user changes parameter values.
as an example, with this PR, you can add this JS to the outer HTML page to propagate parameter values in and out of the dashboard iframe, so you can share URLs to specific queries:
referenced this pull request
Jun 6, 2018
to elaborate a bit, the example JS above propagates the filters in the URL query string into the top-level URL's fragment, eg
If I understand this proposal correctly, were Metabase to adopt this approach with embeds into one's own apps there would be something to latch onto to detect filter selections and pass them up to the parent page or send some from the parent page back to the iframe.
Definitely! This would be a welcome feature for app embeds! To track yes, and to allow app end users to save off their own default filter selections to a table within the app itself for a Metabase iframe embed to pick up on demand! Especially with highly dimensional data such an ability would be a big plus! That way rather than refreshing a page or iframe to a blank slate of filter selections or resource specific defaults each app end user could save off their own defaults or favorite selections! Brilliant!
Having read @salsakran's response to #6604 -- "We're definitely not going to default an iframe rendered dashboard to the last state of its filters as that does not make sense for the usual in-application embedding case." -- it was looking rather glum for such a feature ever to come about.
But with this approach there's hope! And the sooner the better! Speaking for myself I could put this to use today were it available!