My USE_IsInactive variable is either 1 or 0, depending on the user. I would like that in the display of my Users (via datatables), if the user is activated, the link 'Deactive is displayed', and if the user is already disabled, then the link 'Activate' must s' display.
I thought it would be very simple with a small if, but he can not find the value of 'USE_IsInactive'. I tried with == 0 ... I also tried to put a # before the value, nothing makes it.
A little help please?
columns: [
{ data: "USE_FirstName" },
{ data: "USE_LastName" },
{ data: "USE_Gender" },
{ data: "Country" },
{ data: "USE_PhoneNumber" },
{ data: "USE_FirstName" },
{ data: "USE_IsInactive" },
{
date: "USE_Id", "render": function (data) {
if ('USE_IsInactive' == true)
return '<a class="btn btn-primary btn-sm edit" id="' + data + '">Edit</a> <a class="btn btn-success btn-sm acUser" id="' + data + '">Activate</a>';
else
return '<a class="btn btn-primary btn-sm edit" id="' + data + '">Edit</a> <a class="btn btn-danger btn-sm deacUser" id="' + data + '">Deactivate</a>';
}
}
]
Thank you in advance!
Jon