Upload data with pagination in the table
Upload data with pagination in the table
Hi Allan, thanks for Datatable
I have a datatable which if fill out from json,
I try to control the numbering and pagination, first of all i send the page info (page and lenght) .
I use a on change event to get the value of numbering a send
I use a on click event to get the value of a numbering
like this.
$('#tabla_sec_recaudacion').off('draw.dt').on('draw.dt', function () {
$('.paginate_button').on('click', function(){
if ($.fn.DataTable.isDataTable('#tabla_sec_recaudacion')){
var info = table_dt.page.info();
console.log("pagina "+info.page+" cantidad"+info.length);
data.pagina=info.page;
data.numero=info.length;
//table_dt.page(info.page).draw(false);
sec_recaudacion_get_values();
}
});
$('.input-sm').off('change').on('change',function(){
//console.log("ok click pagination");
console.log($(this).val());
if ($.fn.DataTable.isDataTable('#tabla_sec_recaudacion')){
var info = table_dt.page.info();
console.log("pagina "+info.page+" cantidad "+$(this).val());
data.pagina=info.page;
data.numero=$(this).val();
//table_dt.page(info.page).draw(false);
sec_recaudacion_get_values();
}
});
});
i have problems when send the pagination, the page always returns in the number 1, i doesnt change the page i want.
please help,thanks in advance.