:: Forum >>

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
Wednesday, July 27, 2005
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
Monday, August 8, 2005
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
Tuesday, August 9, 2005
I don't know php but should you escape the charecters in php to stop it converting them?
Tuesday, August 9, 2005

This topic is archived.


Back to support forum

Forum search