I want to use jquery dataTables to show something.
It works well when i just put one dataTable in one page, Then i add one more, but they occupied almost the same position, and one of them doesn't work well.
Do you know how to deal with that?
I want to use jquery dataTables to show something.
It works well when i just put one dataTable in one page, Then i add one more, but they occupied almost the same position, and one of them doesn't work well.
Do you know how to deal with that?
Too lazy to google? .) There you go: http://www.datatables.net/examples/basic_init/multiple_tables.html
The examples show static data, not from server. I think it can't be used in my case. Thanks.
It is possible with server side processing. I have it working in a number of locations in my application. You just need to follow the example code for the server side processing multiple times...
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "../examples_support/server_processing.php"
} );
} );
replacing #example
with #id-of-your-table
and "sAjaxSource": "../examples_support/server_processing.php"
with "sAjaxSource": "url/to/your/server/side/script"
.
My guess is that you used the .dataTable
selector from the multiple tables example. Which will apply the same setup to all tables with the dataTable class.