I'm implementing switchery into datatable in this way
UPDATE
var table = $('#table').DataTable({
pageLength: 25,
responsive: true,
deferRender: true,
stateSave: false,
info: false,
ordering: false,
dom: 'lTfgt<"float-left"i>p',
ajax: {
"url": "../src/routes.php",
"type": "POST",
"async":true,
"dataType": "json",
"data": function(d) {
d.call = "data-vol";
d.dataform = $('#filtroForm').serialize();
d.market = JSON.stringify($('#jstree_topmarket').jstree("get_selected"));
return d;
}
},
language: {
"url": "assets/js/plugins/dataTables/it_IT.txt"
},
"fnDrawCallback": function() {
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
elems.forEach(function(html) {
var switchery = new Switchery(html, { size: 'small' });
});
}
});
and seems ok
but when I switch to page 2 and then come back to page 1, I have this result
EDIT
Replacing fnDrawCallback with initComplete seems not working


