I want to check the status which is come from a model in the form 0 and 1 but I have to show 0 as a enable and 1 as a disable but don’t know how to use if below code
@push('scripts')
<script type="text/javascript">
$(document).ready(function() {
$('#role-table').DataTable({
serverSide: true,
processing: true,
responsive: true,
ajax: '{{ route("admin.role.getRoleList") }}',
columns: [
{ data: 'id', name: 'id',className:'text-center' },
{ data: 'name', name: 'name' },
{ data: 'status', name: 'status' },
{ data: 'action', name: 'action', classrole: 'text-center', orderable: false }
],
stateSave: true
});
});
</script>
@endpush
2
Answers
Write your yajra datatables query like this:
For formatting your
status
column, use this:Note that you have the power to use HTML tags for formatting your data columns.
For more information visit DataTable Renders