when we use:
$col["default"] = "<a href='$upload_url/{note}' target='_blank'><img height=100 src='$upload_url/{note}'></a>";
if the field "note" is empty,
and then we click the image link,
it will appear the content of directory
how to prevent it?
Regard,
correct above:
$col["default"] = "<a href='$upload_url/{note}' target='_blank'>view image</a>";
Hello,
You can use conditional data in cell, for e.g.
$blank = "<a href='$upload_url/no_image.jpg' target='_blank'><img height=100 src='$upload_url/no_image.jpg'></a>";
$withimage = "<a href='$upload_url/{note}' target='_blank'><img height=100 src='$upload_url/{note}'></a>";
$col["condition"] = array('$row["note"] == ""', $blank , $withimage);
$cols[] = $col;
Hi,
I'm trying to put imagen file on the Grid, but has been impossible.
It´s showing filename.jpg on column, but image no show…
Thanks by your recommendations, regards!
Refer these settings:
Demo: demos/apperence/image.php
# Custom made column to show link, must have default value as it's not db driven
$col = array();
$col["title"] = "Logo";
$col["name"] = "logo";
$col["width"] = "80";
$col["align"] = "center";
$col["search"] = false;
$col["sortable"] = false;
$col["export"] = false;
// you can also write:
// $col["default"] = "<img height=50 src='http://domain.com/images/{custom_image}'>";
// where custom_image in defined column of grid with filename to show as image (e.g. logo_default.png)
$col["default"] = "<img height=50 src='http://ssl.gstatic.com/ui/v1/icons/mail/logo_default.png'>";
$cols[] = $col;