Unable to display the last page at page loading
Unable to display the last page at page loading
LECARROU
Posts: 4Questions: 3Answers: 0
Hi,
I try to display the last page at page loadin.
I try to use page('first') and fnPageChange('first', false) but it dosen't work
$(document).ready( function () {
$("#table_id").one("preInit.dt", function () {
$("#table_id_filter label").append('<a data-target="" class="btn btn-primary" href="{% url 'randomization_settings:edit' %}" style="width: 190px;margin-left:10px;">Modify settings</a>');
});
if(window.navigator.language.slice(0, 2) == 'fr'){
var table = $('#table_id').DataTable({
lengthMenu: [5,10],
"pageLength": 4,
"bAutoWidth": false,
"language": {
"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/French.json"
},
});
table.page('last').draw(false);
} else {
var table = $('#table_id').DataTable({
lengthMenu: [5,10],
"pageLength": 4,
"bAutoWidth": false,
});
table.page('last').draw(false);
}
} );
This discussion has been closed.
Answers
try using an event handler please:
Thanks a lot, it works !