Property undefined ('nTr')

Property undefined ('nTr')

jdadwilsonjdadwilson Posts: 127Questions: 30Answers: 1

Datatables 2.0 is now implemented throughout one of my sites... txgrayson.org. Couple of issues but all now work.... allmost.

This morning I noticed that the 'Next' paging button throws an error...

TypeError: Cannot read properties of undefined (reading 'nTr')
    at _fnDraw (datatables-2.2.js:3414:17)
    at _fnPageChange (datatables-2.2.js:4818:4)
    at datatables-2.2.js:12860:6
    at HTMLButtonElement.<anonymous> (datatables-2.2.js:6294:5)
    at HTMLButtonElement.dispatch (jquery-1.12.0.min.js:3:12344)
    at r.handle (jquery-1.12.0.min.js:3:9071)

Here is a link... txgrayson.org/cemeteries

As always... TIA
jdadwilson

Answers

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    Searching the forum for the error I found this thread. You have pageLength: [16],. The pageLength docs state it requires an integer.

    Kevin

  • jdadwilsonjdadwilson Posts: 127Questions: 30Answers: 1

    I changed the pageLength items to an integer. Problem still happens..

    txgrayson.org/cemeteries

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    I'm getting an error when loading the page, and the "Next" button never shows:

    JQMIGRATE: jQuery.parseJSON requires a valid JSON string

    Allan

  • jdadwilsonjdadwilson Posts: 127Questions: 30Answers: 1

    Another interesting issue is that on the initial load or selecting the First button, the info at the bottom displays...

    Showing 1 to 016 of 351 entries
    

    Note the leading zero on '016'.

    But the other buttons displays

    Showing 17 to 351 of 351 entries
    

    Note no leading zero. (select button '2').

    Further note that the number of records displayed are 17-351. The pageLength value is not used to set the number of records to display.

    'Next' button does not throw error, but it just doesn't work.

    jdadwilson

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    I'm seeing this error in the console:

    Access to XMLHttpRequest at.<url removed>. has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    The table isn't loading now due to this error. Not sure why all the sudden the CORS error is occurring but it needs fixed so we can continue helping to debug.

    Kevin

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    Note no leading zero. (select button '2').

    That will happen if the response for the server-side processing parameters recordsTotal and recordsFiltered are strings. As the documentation notes they must be integers.

    Allan

Sign In or Register to comment.