我在我的网站上设置了一个数据表,完全正常工作和设置样式。但是,我似乎无法改变语言输出。我在一个不同的堆栈溢出问题上找到了this JSFiddle,我的代码工作正常。
我的代码:
$(document).ready(function () {
$('.datatable').dataTable({
"olanguage":{
"sProcessing": "Bezig...",
"sLengthMenu": "_MENU_ resultaten weergeven",
"sZeroRecords": "Geen resultaten gevonden",
"sInfo": "_START_ tot _END_ van _TOTAL_ resultaten",
"sInfoEmpty": "Geen resultaten om weer te geven",
"sInfoFiltered": " (gefilterd uit _MAX_ resultaten)",
"sInfoPostFix": "",
"sSearch": "Zoeken:",
"sEmptyTable": "Geen resultaten aanwezig in de tabel",
"sInfoThousands": ".",
"sLoadingRecords": "Een moment geduld aub - bezig met laden...",
"oPaginate": {
"sFirst": "Eerste",
"sLast": "Laatste",
"sNext": "Volgende",
"sPrevious": "Vorige"
}
},
"sPaginationType": "bs_normal"
});
$('.datatable').each(function () {
var datatable = $(this);
var length_sel = datatable.closest('.dataTables_wrapper').find('div[id$=_length] select');
var search_input = datatable.closest('.dataTables_wrapper').find('div[id$=_filter] input');
search_input.attr('placeholder', 'Zoek');
search_input.addClass('form-control input-sm');
length_sel.addClass('form-control input-sm');
datatable.bind('page', function (e) {
window.console && console.log('pagination event:', e)
});
});
});
我也试过
"language": {
"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Dutch.json"
},
导致了相同的结果;在小提琴上工作,在我的剧本中没有用。