Hallo Abu,
i want to show in a column(Values 0/1) an image with an link on click. The Image should only appear, when the value of the grid-cell ist "1".
What have i to do?
regards
Gerd
1 Answers
You can refer demos/appearance/conditional-data.php
$img = "<a target='_blank' href='http://www.amazon.com?id={id}' style='text-decoration:none; white-space:none; border:1px solid gray; padding:2px; position:relative; width:25px; color:red'><img src='{path_src}'></a>";
# use single quote for condition, and $row will have all columns data, to use in condition (can also use {total} or {amount})
$col["condition"] = array('$row["total"] == 1', '', $img);
$cols[] = $col;
You can also check on_data_display event in docs > conditional content (http://phpgrid.org/docs)
Your Answer