Hi all,
I start using DataTables in my php project to show data from SQL table. The thing is that I need to send all the data from the whole table to my php script after pressing submit button, but it sends only "visible" data. For example - I have table that have 1k rows paginated "by 50". When I press Submit it sends only 50 rows of "visible" data instead of all of them.
I found related problem on this forum from 2015, it suggest to use var data = table.$('input, select').serialize(); but it does not work for me. Also, when I set it my browser starts to shows DataTables warning: table id=datatable - Cannot reinitialise alert.
What is in index:
$(document).ready(function() {
var table = $('#datatable').DataTable( {
paging: true,
displayStart: 0,
pageLength: 50
} );
$('button').click( function() {
var data = table.$('input, select').serialize();
window.location.replace("http://test.page.com/test.php?" + data);
return true;
});
});
How can I post data from whole table?