i updated datatables from 1.13.6 to 2.3.2 and it broke ajax calls

i updated datatables from 1.13.6 to 2.3.2 and it broke ajax calls

mscarpacemscarpace Posts: 8Questions: 1Answers: 0

I will provide you with a just a snippet of the previously working ajax call and the subsequent error message:

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 22,162Questions: 26Answers: 5,102
    edited July 10

    a is not a function is difficult to debug. Not sure what a is with minimized code. Possibly you can use the non-minified version of datatatables.js and provide the traceback.

    I see the you are setting some Datatables config with dataResults but I don't any Datatables code.

    Looks like the error might start in a function called getData(). What is in that function?

    Have you looked at the XHR request and response for any issues?

    Can you post a link to your page or test case replicating the issue so we can help debug? You can PM Allan with connectivity details to keep your page private.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • mscarpacemscarpace Posts: 8Questions: 1Answers: 0

    Hey kevin,

    Thank for getting back to me. I replaced the minified js and css files for datatables to the full version and, oddly enough, the error changed. It is similar but instead of 'a is not a function' it says 'plugin is not a function'

    I went into that full datatables.js file and located where the error is thrown

  • mscarpacemscarpace Posts: 8Questions: 1Answers: 0

    Sorry Kevin, I think i got it. I read that "input" is longer an option for "pagingType". I read somewhere online that you can start using the latest datatables files as they are backwards compatible. Unfortunately, this was misinformation. Although this is the only migration issue I found, do you know if there is migration documentation.

  • kthorngrenkthorngren Posts: 22,162Questions: 26Answers: 5,102
    Answer ✓

    Start on the blog page in 2024. The first is DataTables 2!. It will have links to migration notes, etc. There is an Input Paging plugin blog just above it. There is also a blog for Datatables 2.3.

    I wouldn't say it's backward compatible. There changes that are much different than the way 1.x worked. I think all of the plugins need upgraded to support 2.x which might be what you ran into.

    Kevin

  • allanallan Posts: 64,756Questions: 1Answers: 10,716 Site admin
    Answer ✓

    Yeah, the pagination structure was completely rewritten for v2 - the old plugins from v1 will no longer work I'm afraid. However, as Kevin notes, the input plugin is one that I have updated for v2 and the code linked there will work with the new structure :)

    Allan

  • mscarpacemscarpace Posts: 8Questions: 1Answers: 0

    Thank you allan!

  • mscarpacemscarpace Posts: 8Questions: 1Answers: 0

    ty for the information kevin!

Sign In or Register to comment.