The column is_active has 2 types of value, value 1 should be equal to Active and value 2 should be equal to Inactive. Now I want to display Active or Inactive in the column according to a condition. How to do this?
Table implementation
function loadTemplates() {
template_table = $('#template-table').DataTable({
processing: true,
serverSide: true,
"ajax": {
"url": 'template-table',
"type": "POST",
"data": function (d) {
d._token = "";
}
},
"aaSorting": [[0, 'desc']],
"fnDrawCallback": function (oSettings) {
rowHighlight('template-table');
selectRowOnTableLoad(oSettings, 'id', selectedRowID);
dataTableRow = oSettings;
},
columns: [
{data: 'id'},
{data: 'title'},
{data: 'start_date'},
{data: 'end_date'},
{data: 'is_active'},//column need to be displayed a text
{data: 'template_content'},
{data: 'action', orderable: false, searchable: false}
]
});
}
Aucun commentaire:
Enregistrer un commentaire