Re: Visualization Table (Select event and hyperlink)

110 views
Skip to first unread message

Manuel Bernal

unread,
Jun 28, 2013, 2:29:38 PM6/28/13
to google-visua...@googlegroups.com
I have the same problem, I'm going mad looking for a solution on the internet.

Did you find any solution?

Regards,
Manuel

El jueves, 14 de junio de 2012 11:06:03 UTC+1, Balamurugan Kalia escribió:
Hi.

I have a Table chart in which I have implemented a listener for Table Select event. I also have a column which has html with a link based on the content. 
When I click on the link, the link is not executed instead the Table select event is executed. If I remove the event listener, the hyper link gets executed.

Is there a way to have the link execute while the select event listener is active?

Regards,
Bala.

asgallant

unread,
Jun 28, 2013, 2:52:07 PM6/28/13
to google-visua...@googlegroups.com
The select event for the table kills the event bubbling of the click event, so the hyperlink does not register a click event.  If you want to override that behavior, you will have to implement your own click events on the table rows.  The rows don't contain any reference to the data, though, so it can be problematic to determine what data the row corresponds to.

David Manz

unread,
Aug 17, 2015, 3:22:52 PM8/17/15
to Google Visualization API
I had the same problem, and I have a solution.  I had a table with a select handler and links that I wanted to open up in new windows without triggering the select handler or altering the selection.

I was seeing the problem where the link was not receiving the click.  This was because my table selection handler was updating the data in one of the columns in the table and redrawing the table so that it would reflect the change.  The redraw of the table destroys all of the elements, so the link never receives the click.  For testing purposes, I removed the redraw, and the link would be followed but I still had a problem where clicking on the link would change the selection in the table, which I did not want to happen.

So, here's my solution.  It's ugly, but it works.  I use the onmouseover event of the link to store the selection and remove the select handler.  Then, the link will function properly, and I use the onmouseout event to restore the selection and add the select handler back onto the table.

You can see my solution here:  https://jsfiddle.net/w2nLxxx8/

David
Reply all
Reply to author
Forward
0 new messages