One of my columns uses an on_data_display
function so that cells in that column are conditionally shown as links (based on contents of other columns). For example, some cells in that column might have the following content:
<a target='_blank' style='cursor:pointer; color:darkblue; text-decoration:underline; font-weight:bold;' href='/ran/plan/frontSheetENew1.php?id4G={$data["id4G"]}'>{$data["nominal"]}</a>
While others might simply have:
$data["nominal"]
However, when I export rows in csv format, I’d like for all cells in this column to have the simple $data["nominal"]
format, rather than showing as the full <a>
tag like the above.
I played around with an on_export
function, but couldn’t find any way of adjusting the values in the cell as they were exported.
Is this possible?
Easy way to achieve results is to have 2 columns with same field source, #1 with link and #2 plain value.
For #1 with link, set no to show in export
$col[“export”] = false;
For #2, set to show in export and hidden rest
$col[“export”] = true;
$col[“hidden”] = false;
Hope it helps.
Thanks for the suggestion Abu.
Is it necessary to SELECT
the column twice in the select_command
query? Or can I have two different grid columns both reference the same field from the query? I couldn’t figure out how to make that work, and had to go with separate fields in the query, but would prefer the second way for cleanliness.