dom-checkbox and datetime-moment
dom-checkbox and datetime-moment
mvlado
Posts: 2Questions: 1Answers: 0
Hi,
When I use those two plug-ins on same table, dom-checkbox doesn't work. If I remove moment initialization, dom-checkbox work. Why is that and how to solve that?
This is my datatable initialization:
$(document).ready(function () {
$.fn.dataTable.moment('DD/MM/YYYY HH:mm:ss');
$.fn.dataTable.moment('MM/DD/YYYY HH:mm:ss');
$.fn.dataTable.moment('DD/MM/YYYY');
$.fn.dataTable.moment('MM/DD/YYYY');
$.fn.dataTable.moment('DD.MM.YYYY HH:mm:ss');
$.fn.dataTable.moment('MM.DD.YYYY HH:mm:ss');
$.fn.dataTable.moment('DD.MM.YYYY');
$.fn.dataTable.moment('MM.DD.YYYY');
$('#DataTable').DataTable(
{
"columnDefs": [
{
"targets": [6, 7],
"orderDataType": "dom-checkbox"
},
{
"targets": [8,9],
"orderable": false
}
],
"order": [[0, "desc"]]
}
);
});
Thanx.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Interesting problem. Looks like the
datetime-moment.js
type detection sets a column with HTML adatetime
data type. I took the CDN plugin code and put it in this example:http://live.datatables.net/yulemina/1/edit
In the type detection for the code it strips the HTML then if the result is
""
ornull
it types the column asdatetime
. However if you look at the code in the Datetime Sorting Bolg it doesn't strip the HTML.I see two choices; One is to use the code in the blog or use
columns.type
totext
.Kevin
Hi Kevin,
Thanks a lot, i fix the problem. I use columns.type option as you do in example.