Uncaught TypeError: Cannot read property 'i18n' of null

Uncaught TypeError: Cannot read property 'i18n' of null

NettSiteNettSite Posts: 36Questions: 11Answers: 2

Hi,

When I load the "Buttons" extension ("vendor/DataTables/Buttons-1.5.2/js/dataTables.buttons.js") I get the following error:

Uncaught TypeError: Cannot read property 'i18n' of null
    at text (dataTables.editor.js:7401)
    at text (dataTables.buttons.js:523)
    at Buttons._buildButton (dataTables.buttons.js:583)
    at Buttons._expandButton (dataTables.buttons.js:475)
    at Buttons.add (dataTables.buttons.js:160)
    at Buttons._constructor (dataTables.buttons.js:379)
    at new Buttons (dataTables.buttons.js:85)
    at Object.fnInit (dataTables.buttons.js:1893)
    at _fnAddOptionsHtml (jquery.dataTables.js:3681)
    at _fnInitialise (jquery.dataTables.js:4703)

I have used the "Download" facility to download all the scripts, and have used the suggested code to load the CSS and JS. I am avoiding the CDN approach because my internet connection is dodgy. (Hello from Africa!)

I have pasted the relevant code here: https://pastebin.com/1Dg24zTj

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,469 Site admin

    What are the reset and reload buttons? Do you define them somewhere? Those aren't part of the built in button types so they would need to be added by plug-ins, but I don't see that in your code.

    Beyond that, can you use JSFiddle, CodePen or http://live.datatables.net to create a test case showing the issue please so I can help further debug it?

    Allan

  • NettSiteNettSite Posts: 36Questions: 11Answers: 2

    Hi Allan,

    Thanks. I did remove the "reload" and "reset" buttons, but the miraculous recovery I was hoping for didn't occur.

    I am working around the problem for now due to deadline pressures, but I will revisit it in a bit, and create a test case.

  • allanallan Posts: 63,489Questions: 1Answers: 10,469 Site admin

    Sounds great. Just bump this post if you get a chance to show the issue and I'll take a look.

    Allan

  • NilsJNilsJ Posts: 12Questions: 5Answers: 0

    I have the sam issue, did you resolve it?

This discussion has been closed.