conditional if in datatable row

conditional if in datatable row

monodaz14monodaz14 Posts: 1Questions: 1Answers: 0

i allready got the data from DB , my data is 0 or 1
and now i'm trying to do some if steatment in my row, so if the data is zero then is't change to off, if is't 1 then change to on
how can i do that,
sorry for my bad english

Answers

  • pkwdadminpkwdadmin Posts: 8Questions: 1Answers: 1

    It's not clear from your question, but you might want a custom render function (columns.render), for example:

        {
            data: "boolean_column",
            render: function(data, type, row) {
                return (data ? "On" : "Off");
            },
        }
    
This discussion has been closed.