datatable does not load the table header
datatable does not load the table header
ciao,
posto il codice js
``js
`success: function(data){
if (data.status){
$(document).ready(function() {
$("#tableControll").DataTable( {
scrollY: "800px",
scrollCollapse: true,
fixedHeader: true,
scrollX: true,
"data": data.data,
"columns": [
{
"className": "details-control",
"orderable": false,
"data": null,
"defaultContent": ""
},
{ "data": "art" },
{ "data": "rep" },
{ "data": "oper" },
{ "data": "attiv" },
{ "data": "id_control" },
{ "data": "id_class" },,
{ "data": "val_max" },
{ "data": "val_min" },
{ "data": "val_note" },
]
});
});
var table = '<br>
Art | Rep | Oper | Attiv | Id Contr. | ' + 'Class | Val. Max | Val. Min | Val. Note |
---|
';
$("#data").html(table);
} else {
alert(data.errMsg);
location.replace("../");
}
},
```
PHP returns a json. I pass the data to datatable there via the return call, because in addition to the data i also have the success status of the actions in php.
thank you
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
Replies
Use
columns.title
to have Datatables create thethead
.Kevin
Thanks... sorry for the delay in replying... i solved