Custom JS events from grids
How can I drive a Custom JS from a grid?
-
Official comment
Here's some code you can modify and use accordingly:
select concat("<button onclick='httpGet("",<yourcolumn>,"")'>Click</button>
<script>
function httpGet(code){
const theUrl2 = '<yoururltocall>'+code;
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( 'GET', theUrl2, false );
xmlHttp.send( null );
alert(theUrl2);
}
</script>") as tmp, *
- Put the above (or a variation of it) into the Cloud9QL filter at the widget level (widget in a dashboard --> Filter icon --> Cloud9QL Transformation at the bottom).
- Change the column type to HTML on grid.
Comment actions
Please sign in to leave a comment.
1 comment