Elankeeran
Elankeeran

Reputation: 6184

jQuery DataTable - need to change the label based on the row value in run time

enter image description here

Below table developed in the jQuery DataTable Need to add label for Status based on the condition if status "0" then "Inactivate" and for "1" - Active.

Upvotes: 4

Views: 2432

Answers (2)

"render": function (data, type, row) {
                    if (data == "Y") {
                        data = "Approved"
                    }
                    else
                    {
                        data = "Pending"
                    }
                    return data
                },

Upvotes: 0

mg1075
mg1075

Reputation: 18155

Have you investigated fnRowCallback?
http://datatables.net/usage/callbacks#fnRowCallback

If you look at the example on the DataTables site, and play with the jsbin example, it sure seems to be what you're looking for...

Upvotes: 2

Related Questions