Multiple DataTables on one page

Multiple DataTables on one page

marcelgroenewegmarcelgroeneweg Posts: 12Questions: 4Answers: 0

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

  • F12MagicF12Magic Posts: 109Questions: 0Answers: 28
    Answer ✓

    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.

  • marcelgroenewegmarcelgroeneweg Posts: 12Questions: 4Answers: 0

    Thanks a million! I used a unique CSS selector, now I make sure the ID is unique and it works!

This discussion has been closed.