<ejs-pivotview id="PivotView" height="300" hyperLinkCellClick="hyperlink")The event hyperlinkCellClick fires on every hyperlink cell click.
It has following parameters - cancel and currentCell. The parameter currentCell is used to customize the host cell element by any means. Meanwhile, when the parameter cancel is set to true, applied customization will not be updated to the host cell element.
|
<script>
function onCellClick(args) {
//Here you can customize the hyperlink based on the current cell information(can be found in args.data)
if (args.currentCell.querySelector('a') &&
(args.currentCell.querySelector('a').innerText === 'France' || args.currentCell.querySelector('a').innerText === 'Germany')) {
var country = args.currentCell.querySelector('a').innerText;
args.currentCell.querySelector('a').setAttribute('data-url', (country === 'France' ?
'https://en.wikipedia.org/wiki/France' : 'https://en.wikipedia.org/wiki/Germany'));
args.cancel = false;
} else if (args.currentCell.querySelector('a')) {
args.currentCell.querySelector('a').setAttribute('data-url', 'https://www.google.com/');
args.cancel = false;
}
};
</script> |