Den torsdag den 16. august 2012 14.34.12 UTC+2 skrev Michael Friderichsen:
> Hi, i'm having some trouble adding hyper-links or buttons to orgChart nodes: 
> here is what i do:
> 
> 
> 
> google.load('visualization', '1', {packages:['orgchart']});
> google.setOnLoadCallback(drawChart);
> 
> 
> 
> function drawChart() {
> 
> 
>     chart = new 
> google.visualization.OrgChart(document.getElementById('chart_div'));
>     data = new google.visualization.DataTable();
> 
> 
>     data.addColumn('string', 'Name');
>     data.addColumn('string', 'Manager');
>     data.addColumn('string', 'tip');
>     data.addColumn('boolean', 'expanded');
>     data.addRow([{v:'cn=Faaborg-Midtfyn Kommune,ou=depts,ou=structures,o=dk', 
> f:'Faaborg-Midtfyn Kommune'},'','', true]);
>     
>  
>     data.addRows([[{v:Mark, f:'<div>Mark</div><div><a 
> href="info.html">Info</a></div>'}, '', '', false], [{v:'John', 
> f:'<div>John</div><div><a href="info.htm">Info</a></div>'}, 'Mark', '', 
> false]]);    
>     chart.draw(data, {allowHtml:true,allowCollapse:false,size:'medium'});
> 
> 
>     google.visualization.events.addListener(chart, 'select', selectHandler);  
>           
> }
> 
> 
> With the above code, i can click the nodes which calls the selectHandler() 
> function, but i can't click the hyper-link on the nodes, it triggers the 
> underlaying selectHandler().
> Is it possible til have links or buttons in the content of the nodes and be 
> able to cllick on them?
> 
> 
> / Michael.

I found a solution. I just added mouseover and mouseout attributes to the 
hyper-link, and removed the select event on mouse over, and added it again on 
mouse out.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/-05B5EOQqV8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to