How to add a custom call by onclick event in data links?

Grafana 7.2.1 embedded in iframe behind proxy.

What is the best strategy to provide an onclick call by a data link?

For example: Edit link option (Panel -> Field -> Datalinks) provides only sanitized url input and selector “Open in new tab”. This results in the following html:

<… href=“protocol://example…” target="_blank" class=“css-ku00la”>


<… href=“protocol://example…?1604831022177” target="_blank" class=“css-ku00la”> (in case of url: protocol://example…?${__value.time})

What is actually desired is to get something like:

<… href="#" onclick=“parent.customOnClick();” class=“css-ku00la”>

where customOnClick() will look like:

function customOnClick () {
    console.log ('do you code here');
    return false;

It could be also great to get the variable values, e.g. {__value.time} from custom Javascript.

Thanks in advance.