Jump to content

Format custom link next to standard data download button in combined chart / report


Recommended Posts

Any ideas on 'how to format' this custom link to be inline with the 'data download' link and include an icon? Please see below code I'm using for the custom link placement and the attached image, thank you:

 

<script type="text/javascript">
document.addEventListener('DataPageReady', function (event) {

var child = document.querySelector("li[id^='DataDownloadButton']");
var parent = child.parentElement;

 var a = document.createElement('a');
      var linkText = document.createTextNode("my title text");
      a.appendChild(linkText);
      a.title = "my title text";
      a.href = "http://example.com";

parent.parentNode.appendChild(a);

});
</script>

 

 

Datapage.png

Link to comment
Share on other sites

On 8/26/2022 at 5:13 PM, futurist said:

Hi @Afzal1

this might help: 

 

Thank you, I've managed to tweak some the javascript to get this to work now... I'd already seen and used some of these suggestions hence my link to it also as acknowledgement...  Just need to figure out how to include the icon in the javascript (the html / css versions place the link above the chart in the combined report and chart datapages but I need it to appear below the chart besides the 'download data' link).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...