server side render status=1 or 2 or 3
server side render status=1 or 2 or 3

Hi guys
This works fine
$member->status == 1?'Active':'Inactive',
but what if i have status 1=Active 2=Inactive 3=Problem
I have been searching but not getting there.
This discussion has been closed.
Answers
Hi @AGR ,
Is this with Editor? If so, you can use customer formatters, this is a function so you can do multiple
if
s in there.If just
serverSide
, see the "Server-side script" tab on this page. The final column,salary
, is being formatted within a function, you could do that same with your string.Cheers,
Colin
Hi Colin
not really sure how to set the code for the 3 options or if its possible.
OK/ NOK is easy. On worst case it will show 1,2,3.
This is how I would format that code to make it a bit more readable:
and that looks okay to me. In what way is it not working - any error messages?
That said, you have
status
in the data you are sending to the client, so you could just use acolumns.render
function and useif
statements like Colin suggested.Allan