I am using DataTables to display data as bootstrap cards. So each TR is a card and displays a few TDs with data.
My table:
$('#requestsTable').DataTable({
data: data.value,
columns: [
{ //Remote Connection column
title: "Assets icon",
className: 'asset-icon',
data: function(row){
return row["some_data"]?.["some_data"];
},
{ //Asset column
title:"Assets",
data: function(row){
return row["some_data"]?.["some_data"];
},
defaultContent: ""
}
]
})
I am not using a thead so the "title" of the column is not useful in my case.
The content of the "data" property will display on a TD and I need to display the TD title before each TD data so it would display like this for example: Assets: Mobile phone instead of Mobile phone.
I could add it to the return of the function in "data" but that will then affect the filtering functionality so it has to be some other way which does not affect the filtering functionality. I have been breaking my head around this and can't seem to find a solution and would really appreciate any help.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/hkZRoGI
Comments
Post a Comment