what is the way to get the color code as a color strip to the datable? In the attached picture it shows how the color code pass to the datatable. I need to replace the code with the relavant color strip. Is it possibole and what is the correct way?
$("#ServiceCreatorTable").DataTable
({
"processing": true,
"serverSide": true,
"filter": true,
"ajax": {
"url": window.ApiUrl + "/ServiceCreator/GetServiceDetails",
"type": "POST",
"datatype": "json"
},
"columnDefs": [{
"targets": [0],
"orderable": true,
},
{
"targets": [8],
"searchable": false,
"orderable": false
}],
"columns": [
{ "data": "service_Creator_Id", "name": "Service ID", "autoWidth": true },
{ "data": "service_Creator_Code", "name": "Service Code", "autoWidth": true },
{ "data": "service_Creator_Name", "name": "Service Name", "autoWidth": true },
{ "data": "service_Creator_Desc", "name": "Service Description", "autoWidth": true },
{ "data": "service_Category_Name", "name": "Service Category ID", "autoWidth": true },
{ "data": "service_Sub_Cat_Name", "name": "Sub Service Category ID", "autoWidth": true },
{ "data": "no_of_Sub_Services", "name": "No of Services", "autoWidth": true },
{ "data": "colour", "name": "Service Colour", "autoWidth": true },
{
'data': null,
'render': function (data, type, row) {
return '<button class="btn btn-outline-danger btn-sm text-center" onclick="deleteservice(' + row.service_Creator_Id + ')"><i class="fas fa-trash-alt"></i></button>'
}
},
]
});
<table id="ServiceCreatorTable" class="table table-striped table-bordered table-responsive-sm" width="100%">
<thead>
<tr>
<th>SN</th>
<th>Code</th>
<th>Service Name</th>
<th>Description</th>
<th>Service Category</th>
<th>Sub Service Category</th>
<th>No Of Sub Services</th>
<th>Colour</th>
<th></th>
</tr>
</thead>
</table>
