mode / alamode

A community-maintained library of visualizations for Mode reports
MIT License
70 stars 67 forks source link

addLinksToTables option to open in same window #35

Closed bflannery closed 5 years ago

bflannery commented 5 years ago

My current application is running mod white-label embedded reports using addLinksToTables and would like to have the report links stay within the same window/tab so the user history is intact for navigation.

I noticed @joecorkerton was having the opposite issue in Issue-13.

At the time of writing this, the code does not allow and option to set the target on the links. Would it be possible to add this functionality?

plentz commented 5 years ago

@bflannery I think that this is the current (default) behavior and actually, @joelcarron's issue is the one that needs to be solved 🤔

leqilong commented 5 years ago

Hi @plentz @bflannery - yeah the current behavior is that the tabs always opened in the same tab. There's a recent PR that adds a parameter in the function call that would allow you to choose whether you want links to open in new tab or not. I've deployed that PR. And now you could use the parameter "open_in_new_tab" to control this. Example:


<script>
  alamode.addLinksToTables({
    table_id: "table_12345",
    query_name: "q1",
    link_columns: ["url"],
    link_urls: ["{{url}}"],
    open_in_new_tab: true
  });
</script>
bflannery commented 5 years ago

Thanks getting back to me @leqilong @plentz that recent PR fixed the issue I was having. When the link is clicked, a new window does not open unless the open_in_new_tab key is true

plentz commented 5 years ago

So we can close this one, right?

leqilong commented 5 years ago

Yup, @plentz. Closing this one now.