I have a datatable with 2 columns. status and enable_hyperlink (0 or 1). I want to make the status row item a clickable url if the enable_hyperlink = 1. What’s the best way to do that?
Nevermind. I figured it out. Here’s what I did.
columns: [
{
id: "status", width: 120, header: "Status", template: function (obj, value) {
if (obj.enable_hyperlink == "1") { return '<aa hre f=' + baseurl + '/' + obj.status + '>'+ obj.status + '</a>' } else { return obj.status };
}
},
{ id: "total", width: 120, header: "Total" },
{ id: "enable_hyperlink", width: 120, header: "enable_hyperlink", hidden: true }
]
sorry, I can’t display my solution correctly. I could post a picture if allowed.