DataTables is not a function

DataTables is not a function

kortsommarkortsommar Posts: 2Questions: 1Answers: 0

Link to test case: unable to share
Debugger code (debug.datatables.net): n/a
Error messages shown: DataTables is not a function
Description of problem: I have a page with a working DataTables, when adding another web part to that page the DataTables fail with error "DataTable is not a function". I am running in noconflict so my guess is that jquery is being loaded in the other webpart and breaking DataTables. I cannot see multiple jquery in network tab however. I am unable to edit the other webpart being added, would anyone have any hints in how I can ensure DataTables is loaded properly without the other part breaking it?

Answers

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    Happy to take a look at a test case showing the issue.

    Allan

  • sophiaabigailsophiaabigail Posts: 1Questions: 0Answers: 0
    edited June 2022

    adding another web part to that page the DataTables fail with error "DataTable is not a function". I am running in noconflict so my guess is that jquery is being loaded in the other webpart and breaking DataTables. I cannot see multiple jquery in network tab however. I am unable to edit the other webpart being added, would anyone have any hints in how I can ensure DataTables is loaded properly without the other part

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    @sophiaabigail It would be worth checking the ordering of the scripts, and ensure jQuery is loaded first. If no success, as Allan said above, please link to a page demonstrating the issue.

    Colin

  • kortsommarkortsommar Posts: 2Questions: 1Answers: 0

    Hello, thanks for your comments. I understand it is difficult to help when there is no test case. Unfortunately it is an internal system so I cannot show a test case. The issue is happening even when I use the datatables example table and script sources. The issue arrises only when the other webpart is added and I cannot change or manipulate the other webpart. Customer wants the table and the webpart ;)
    Is there anyway I can ensure jquery and datatables loads within my context only, and is not hindered/destroyed by the other webpart?

  • kthorngrenkthorngren Posts: 20,276Questions: 26Answers: 4,765
    edited June 2022

    I'm not familiar with webpart. Someone else on the forum may have some ideas for you. I suggest looking at the webpart documentation or webpart specific support forums to learn how to integrate jQuery applications.

    Kevin

Sign In or Register to comment.