addClass doesn't work consistently
addClass doesn't work consistently
Hello,
I have a strange behaviour. I'm using the latest datatables (1.11.3) and would like to apply a class to all the cells of a column. This is the code which was working for datatables 1.10:
"columns":[ {
"className": "dateSent",
}, {
"orderable": false,
}, {
"orderable": false,
}, {
"orderable": false,
}, {
"orderable": false,
}, {
"orderable": false,
}]
});
Since I updated to the latest version yesterday, the class is set apparently inconsistently, sometimes it is there, sometimes not. Changing the code above to:
"columnDefs": [
{"orderable": false, "targets": [1,2,3,4]},
{"className": "dateSent", "targets": [0]}
]
bears the same result. The column I want to apply the class to only has a sorting_1
class sometimes. Is this a bug / known issue, or is there something else I can do in order to force those rows to get that class?
This question has an accepted answers - jump to answer
Answers
The code snippet you provided is working in this test case with 1.11.3.
http://live.datatables.net/zonoquxi/1/edit
Please update the test case or provide a link to your page to show the issue so we can help debug.
Kevin