Hmmm....this is an odd one. It seems to work sometimes, depending on what
is actually done inside the event handler. I'm not quite sure how the API
implements event listeners, but they seem to violate everything I know
about event bubbling/capturing (admittedly, I'm not an expert on the js
event model, though). The 'select' event seems to fire before all other
events, even when I set a capturing event on the container div (which,
according to typical event logic, should always fire before any events on
elements inside the container). It also fires before bubbling events
placed on elements inside the chart element. Neither of these cases makes
sense.
On Thursday, August 16, 2012 8:34:12 AM UTC-4, Michael Friderichsen wrote:
>
> 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.
>
>
>
--
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/-/8J08tE_TBYQJ.
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.