I can get the hyperlink to work if it is the domain but if there is a subpage it goes to a blank page.
eg: website.com works but website.com/contactus goes to a blank page.
All the links show, however when I hover over the links the website.com/contactus link is blank.
I have tried a few ways as seen below.
$col = array();
$col["title"] = "Url"; // caption of column
$col["name"] = "url";
// $col["default"] = "<a href='{url}' target='_blank'>{url}</a>";
// $col["link"] ="<a href='{url}' target='_blank'></a>";
$col["link"] = "http://www.{url}";
$col["linkoptions"] = "target='_blank'"; // opens in new tab
$acols[] = $col;
Thanks
Code seems fine.
1) $col["default"] = "<a href='{url}' target='_blank'>{url}</a>";
2) $col["link"] = "http://www.{url}";
Both should work. Please share complete code or online link for review.
You can email at [email protected]
Thanks Abu,
I have modified your Editing: Bulk Edit demo to show you what I mean.
http://x2.guaranteedseo.com/phpgrid/index.php
I changed a clients name in the database to a link.
Antonio Moreno
to
plus.google.com/+IBM/posts
Then I changed the code as below. You can see it when you go to the site.
//$col["link"] = "http://localhost/?id={id}"; // e.g. http://domain.com?id={id} given that, there is a column with $col["name"] = "id" exist
$col["link"] = "https://{name}";
The problem seems to be with urlencoding. Try following:
$col["on_data_display"] = array("make_url","");
function make_url($data)
{
$name = $data["name"];
return "<a target='_blank' href='http://$name'>$name</a>";
}
Full code: http://hastebin.com/ewibiwihox.php