sDom resets when using AJAX and multiple tables
sDom resets when using AJAX and multiple tables
DominicL
Posts: 2Questions: 0Answers: 0
Hi everyone
I've looked through the forum and haven't found anything similar to what I am experiencing right now (so far).
I want to use AJAX to load different tables formatted with DataTables in one page.
I have three div in my page (all loaded through AJAX from external pages):
- First one is my custom search box
- Second one is my first table (with length changing, table, pagination and information only)
- Third one is my second table (table only)
On the first load, everything is fine. But when I enter anything in the search box, the sDom of the second table is reset to the default one (with length changing, filtering, pagination, information)
Could someone help me find what I'm doing wrong?
Thank you
I've loaded a debug page and uploaded it to DataTables live.
Debug: http://debug.datatables.net/uwudun
Live: http://live.datatables.net/osokem/4
I've looked through the forum and haven't found anything similar to what I am experiencing right now (so far).
I want to use AJAX to load different tables formatted with DataTables in one page.
I have three div in my page (all loaded through AJAX from external pages):
- First one is my custom search box
- Second one is my first table (with length changing, table, pagination and information only)
- Third one is my second table (table only)
On the first load, everything is fine. But when I enter anything in the search box, the sDom of the second table is reset to the default one (with length changing, filtering, pagination, information)
Could someone help me find what I'm doing wrong?
Thank you
I've loaded a debug page and uploaded it to DataTables live.
Debug: http://debug.datatables.net/uwudun
Live: http://live.datatables.net/osokem/4
This discussion has been closed.
Replies
[code]
$('#table2').dataTable({"sDom": t;});
[/code]
right after the "sDom": t
Thanks for pointing this out but it isn't actually the error. While looking at this, I actually found out that the sDom value wasn't encapsulated in single quotes.
Changing
[code]
$('#table2').dataTable({"sDom": t;});
[/code]
to
[code]
$('#table2').dataTable({"sDom": 't'});
[/code]
fixes the issue.
Thanks