Pagination problems when using two datatables on one page
Pagination problems when using two datatables on one page
Hello,
I have two tables on one page but seem to have a problem with the pagination. When I use the search in the first table, a page "1" is added in the second table for every character I type. The first table has no pages in the pagination area, just the buttons.
My code:
[code]
...
...
$('.datatable').dataTable({
"sPaginationType": "bs_full"
});
$('.datatable').each(function(){
var datatable = $(this);
// SEARCH - Add the placeholder for Search and Turn this into in-line form control
var search_input = datatable.closest('.dataTables_wrapper').find('div[id$=_filter] input');
search_input.attr('placeholder', 'Filter');
search_input.addClass('form-control input-sm');
// LENGTH - Inline-Form control
var length_sel = datatable.closest('.dataTables_wrapper').find('div[id$=_length] select');
length_sel.addClass('form-control input-sm');
});
[/code]
Anyone an idea?
Thanks,
Mark
I have two tables on one page but seem to have a problem with the pagination. When I use the search in the first table, a page "1" is added in the second table for every character I type. The first table has no pages in the pagination area, just the buttons.
My code:
[code]
...
...
$('.datatable').dataTable({
"sPaginationType": "bs_full"
});
$('.datatable').each(function(){
var datatable = $(this);
// SEARCH - Add the placeholder for Search and Turn this into in-line form control
var search_input = datatable.closest('.dataTables_wrapper').find('div[id$=_filter] input');
search_input.attr('placeholder', 'Filter');
search_input.addClass('form-control input-sm');
// LENGTH - Inline-Form control
var length_sel = datatable.closest('.dataTables_wrapper').find('div[id$=_length] select');
length_sel.addClass('form-control input-sm');
});
[/code]
Anyone an idea?
Thanks,
Mark
This discussion has been closed.
Replies