Datatable fails with dynamically created tabls

Datatable fails with dynamically created tabls

tphilpotttphilpott Posts: 2Questions: 1Answers: 0

The datatable works correctly when I manually add the <li> tabs to the html section of my php page:
()

The number of files/data tabs varies for each customer process, so I need to be able to create the <li> tabs dynamically. When I create the <li> elements dynamically, the datatables do not separate to different tabs and I am unable to click on a tab to activate it. All that happens is it will jump down in the page to the start of that tab's div/table combo.

I tried adding just the elements without classes, and not only did it not work, but the tab appearance changed from what it looked like when I manually added the list elements.

I added in classes and attributes to match the firebug html code for the page when i entered the list elements in the html section of the page, but it did not work
()

It seems as if the datables add the needed classes and attributes to list elements that already exist, but if I add them dynamically, they are static and not under control of the datatable functionality.

Answers

  • tphilpotttphilpott Posts: 2Questions: 1Answers: 0

    Resolved this by passing the page the number of tabs needed and generating the List Element tabs in PHP section, before the processing the input file and dynamically drawing the jquery data tables.

This discussion has been closed.