3.2.0

URL LINKING COMPLEXITY

Why not have the URL LINK for a ROW be included in the DATA

// data source
var myData = [
["text1", 123.45,"http://www.mylink.com"],
["text2", 678.90,"http://www.mylink.com"]
];
Patrick E
July 27,
It can be included exactly as you have it specified. But you must finish the expression:

// data source
var myData = [
["text1", 123.45,"<a href='http://www.mylink.com'>Link 1</a>"],
["text2", 678.90,"<a href='http://www.mylink.com'>Link 2</a>"]
];
brians
August 8,
That doesn't work, at least when loading the data from a PHP script. I used the example that comes with the grid. If an array is set like this:
$array = array(1, "<a href='http://somelink.com'>here</a>");

this will output the following javascript array:
var data = [
["1", "&lt;a href=\'http://somelink.com\' &gt;here&lt;/a&gt;", ],
];

And this will show in the grid exactly "<a href= (blabla) >" and not actually the link. This is because the function activewidgets_html() calls htmlspecialchars(). Therefore, a quick workaround for this problem is to remove the line that invokes this function.
metator at netcabo dot pt
August 9,
I don't know php but should you escape the charecters in php to stop it converting them?
August 9,

This topic is archived.

See also:


Back to support forum