79517198

Date: 2025-03-18 11:15:01
Score: 0.5
Natty:
Report link

I ended up going with a javascript method. Didn't seem like I had to but I just finally gave in

` columns.Bound(o => o.Email).ClientTemplate("\\#=renderEmail(data)\\#");

columns.Bound(o => o.Phone).ClientTemplate("\\#=renderPhone(data)\\#");

`

function renderEmail(data) {
    if (data.Email) {
        return `<a href="mailto:${data.Email}">${data.Email}</a>`;
    } else {
        return '';
    }
}
function renderPhone(data) {
    if (data.Phone) {
        return `<a href="tel:${data.Phone}">${data.Phone}</a>`;
    } else {
        return '';
    }
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Jay