Error Datatable is not a function

Error Datatable is not a function

kezman10kezman10 Posts: 12Questions: 3Answers: 0
edited March 2023 in Free community support

Good morning, I find myself with a problem that is difficult to understand, I am currently working with PHP/BootStrap 5

I have 2 tables on the same page, the first one loads through ajax and datatable without problem, then I use another second table that I show by modal, when I go to show this second table it gives me an error that datatable is not a function, Tables have different ID

For the modal tests, I have used the table and the javascript of this example, I don't know if to have two tables you have to type some kind of extra code... thanks

https://datatables.net/examples/styling/bootstrap5.html

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    We'd really need to be able to see the code you are using, or much better would be a test case showing the problem. That way I can debug it and see what is going on.

    Allan

  • kezman10kezman10 Posts: 12Questions: 3Answers: 0

    Unfortunately I can't send you a code of 2000 lines, I think I have summarized the problem well, I require two datatables on the same page...

    If you need any specific piece of code tell me...

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Yep, two tables are possible, see here: https://live.datatables.net/zarerovu/12/edit

    Since it works fine there, as Allan said, we'd need to see the problem to further this. A test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

Sign In or Register to comment.