Server Side Rendering

Server Side Rendering

jstw000011jstw000011 Posts: 1Questions: 1Answers: 0

Error messages shown:
jQuery.Deferred exception: Cannot read properties of undefined (reading '_fnCallbackReg') TypeError: Cannot read properties of undefined (reading '_fnCallbackReg')
at u._constructor (http://localhost:8080/tcis/webjars/datatables-responsive/2.2.7/js/dataTables.responsive.min.js:23:412)
at new u (http://localhost:8080/tcis/webjars/datatables-responsive/2.2.7/js/dataTables.responsive.min.js:23:126)
at HTMLDocument.<anonymous> (http://localhost:8080/tcis/webjars/datatables-responsive/2.2.7/js/dataTables.responsive.min.js:47:495)
at HTMLDocument.dispatch (http://localhost:8080/tcis/webjars/jquery/3.6.3/jquery.min.js:2:43336)
at y.handle (http://localhost:8080/tcis/webjars/jquery/3.6.3/jquery.min.js:2:41320)
at Object.trigger (http://localhost:8080/tcis/webjars/jquery/3.6.3/jquery.min.js:2:71942)
at HTMLTableElement.<anonymous> (http://localhost:8080/tcis/webjars/jquery/3.6.3/jquery.min.js:2:72537)
at Function.each (http://localhost:8080/tcis/webjars/jquery/3.6.3/jquery.min.js:2:3003)
at E.fn.init.each (http://localhost:8080/tcis/webjars/jquery/3.6.3/jquery.min.js:2:1481)
at E.fn.init.trigger (http://localhost:8080/tcis/webjars/jquery/3.6.3/jquery.min.js:2:72513)
Description of problem:

I am trying to upgrade from v1.10.19 to v2.1.0
Does the following statement still work for v2.1.0?
$.fn.dataTable.ext.legacy.ajax = true;
It seems to be true by default when I check it.

I found the request sent still includes params.
http://localhost:8080/authSourceAjax?draw=1&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=seq&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=id&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=corporation&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=name&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=cname&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=unitName&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=6&columns%5B6%5D%5Bname%5D=status&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=7&columns%5B7%5D%5Bname%5D=roles&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=1&columns%5B8%5D%5Bname%5D=colAction&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=false&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=1&order%5B0%5D%5Bdir%5D=asc&order%5B0%5D%5Bname%5D=id&start=0&length=25&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1732865226901

Here is my code, is there anything wrong?

$("#dataTables-example").dataTable({
bServerSide : true,
ajax : "/authSourceAjax",
bProcessing : false,
sPaginationType : "full_numbers",
bFilter: false,
responsive: true,
aaSorting: [[ 1, "asc" ]],
aoColumns: [
{sName: "seq" },
{sName: "id", bVisible: false},
{sName: "corporation" },
{sName: "name" },
{sName: "cname" },
{sName: "unitName" },
{sName: "status" },
{sName: "roles" }]
}

Answers

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin

    Does the following statement still work for v2.1.0?
    $.fn.dataTable.ext.legacy.ajax = true;

    No - the legacy Ajax was removed as part of the v2 upgrade. You need to update your server-side script to expect the parameters documented here.

    Assuming that is the issue of course. Without a test case it is hard to be certain.

    Also worth making sure that you updated Responsive and any other extensions you are using.

    Allan

Sign In or Register to comment.