Multiple tables with same parameters but difference JSON in the same web page

Multiple tables with same parameters but difference JSON in the same web page

MzzntnMzzntn Posts: 2Questions: 1Answers: 0

I want to initialize two tables with the same parameters but with two different jsons. The tables must also be loaded on the same page.
How can I do? Thank you very much for helping!

Answers

  • kthorngrenkthorngren Posts: 6,090Questions: 21Answers: 1,347

    Here is an example that might get you started:
    https://datatables.net/examples/basic_init/multiple_tables.html

    Kevin

  • MzzntnMzzntn Posts: 2Questions: 1Answers: 0

    Thanks for the reply.
    I have already seen that page and partially solved my question. However, I can't load two databases because I don't know how to declare the instances.

  • kthorngrenkthorngren Posts: 6,090Questions: 21Answers: 1,347

    One option might be to use HTML5 Attributes to set the ajax option.

    Another option would be to use a variable that contains the Datatables configuration object. Individually init Datatables with the variable. But before initializing set the ajax option.

    Or you could possibly use the ajax.url() API to change the URL of each table.

    There are probably other ways to do this.

    Kevin

Sign In or Register to comment.