How can I format the row values from server to client?
How can I format the row values from server to client?
Hello,
I am having trouble formatting the values I am passing to the client-side table. I am trying a custom getFormatter but I haven't figured it out. On the SQL, I have a column called "appointment_type" with the row values "i" and "o". I want to display these values as "In-Person" (i) and "Online" (o) to the client.
This is the condition I'm trying to fulfill if it helps:
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
if ($row['appointment_type'] == "i") {
$row['appontment_type'] = "In-Person";
} else {
$row['appontment_type'] = "Online";
}
Thank you!
This question has accepted answers - jump to:
Answers
@Alexandr45 is suggesting you use
columns.render
.Kevin
@Alexandr45 and @kthorngren
Thank you for the help!