Try it in Chrome and check the developer's console for errors (ctrl+shift+j
to open in windows). If nothing is showing up there, right click on a link
and select "inspect element" (bottom of the list); make sure that the link
is formatted properly.
My inclination is to say that your column 0 probably contains a string, and
you didn't quote the output in the formatter. Maybe this would work:
var formatter = new google.visualization.PatternFormat('<a href="#"
onclick="getJsonforCountries(\'{0}\');">{0}</a>');
Also, you are only using one column in your formatter, you don't need to
include it twice in the column array you pass to the format method. This
would be sufficient:
formatter.format(data, [0]);
On Tuesday, November 27, 2012 4:52:31 AM UTC-5, Heena wrote:
>
> After setting allowhtml:true, still i am not able to call javaScrippt
> function from <a href> tag. Here's a code snippet:
>
>
> I want to call a java script function getJsonforCountries as soon as i
> click on any link in data table.
>
> *var* formatter = *new* google.visualization.PatternFormat('<a href="#"
> onclick="getJsonforCountries({0});">{0}</a>');
>
> formatter.format(data, [0,0]);
> Help appreciated :)
>
>
> On Thursday, November 15, 2012 12:41:39 AM UTC+5:30, asgallant wrote:
>
>> The Table visualization escapes all HTML content unless you set the
>> "allowHtml" option to true.
>>
>> On Wednesday, November 14, 2012 11:55:05 AM UTC-5, Jonathon McKitrick
>> wrote:
>>>
>>> I have JSON data that will contain a hyperlink, complete as html markup.
>>> I need to display this link as-is, and I think the Table is scrubbing the
>>> cell content before display. Is there a way to suppress this action, or do
>>> I need to break down the tag on the server side, then use a
>>> PatternFormatter to rebuild it before passing it to Table for display?
>>>
>>>
> On Thursday, November 15, 2012 12:41:39 AM UTC+5:30, asgallant wrote:
>>
>> The Table visualization escapes all HTML content unless you set the
>> "allowHtml" option to true.
>>
>> On Wednesday, November 14, 2012 11:55:05 AM UTC-5, Jonathon McKitrick
>> wrote:
>>>
>>> I have JSON data that will contain a hyperlink, complete as html markup.
>>> I need to display this link as-is, and I think the Table is scrubbing the
>>> cell content before display. Is there a way to suppress this action, or do
>>> I need to break down the tag on the server side, then use a
>>> PatternFormatter to rebuild it before passing it to Table for display?
>>>
>>>
--
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/-/ZYY3pV3DKWIJ.
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.