google-chart table: how to store a link or do cell selection?

20 views
Skip to first unread message

Roberto Attias

unread,
Aug 11, 2017, 12:32:54 PM8/11/17
to Google Visualization API

I need to open a new tab with some URL when the user clicks on a cell in a google char table. I was trying to do this by reacting to the cell selection:

google.visualization.events.addListener(table, 'select', tableSelectHandler);
function tableSelectHandler() {
const r = table.getSelection();
const row := r[0]['row'];
const col := r[0]['column'];
URL
= buildURLForRowAndCol(row, col);
...

however it looks like while there is a 'row' attribute, there isn't a column one. Maybe I need to specify that I want to be able to select cells rather than just raws but it's not clear to me how to do that.

As an alternative, I'd be happy to store in the column a link, but I'm not sure how to do that either.

Can anybody help?

Roberto Attias

unread,
Aug 11, 2017, 12:45:13 PM8/11/17
to Google Visualization API
Note: I'd like the solution not to involve jquery if possible...
Reply all
Reply to author
Forward
0 new messages