Multiple DataTables on one page
Multiple DataTables on one page
Hi,
I have embedded DataTables in Mendix. For DataTables that basically means that the object is created dynamically when the page is rendered, there is no static HTML.
Everything is fine unless there is more than one table on the page. I get all kinds of weird issues:
* Column reorder no longer works, throws a weird exception
* Within the draw callback I cannot select rows for the first table on the page, this works for the last table only
* Multisort no longer works
All these features work normally in the examples and on DataTables live.
Is there something extra I need to do so the different DataTables instances on the same page coexist peacefully?
This question has an accepted answers - jump to answer
Answers
I'm working with multiple dynamically created datatables too, but am experiencing no problems. Do you give each table a unique ID and initialize each table with that unique ID? Because that's required to get everything working.
Thanks a million! I used a unique CSS selector, now I make sure the ID is unique and it works!