简体   繁体   中英

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

在此处输入图片说明

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.

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...

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM