Uncaught TypeError: Cannot read property 'i18n' of null

Uncaught TypeError: Cannot read property 'i18n' of null

oliver wongoliver wong Posts: 2Questions: 1Answers: 0

first, i use the tail version editor.

when i selected one row, and click "edit" button, no response but the js error "Uncaught TypeError: Cannot read property 'i18n' of null".

can anyone help me?

Answers

  • oliver wongoliver wong Posts: 2Questions: 1Answers: 0

    btw, i just copy the example of "Simple inline editing", https://editor.datatables.net/examples/inline-editing/simple.html.

    and the first column can't visible.

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    and the first column can't visible.

    Have you included FontAwesome and the CSS shown in the "CSS" tab just below the table in that example, on your page?

    when i selected one row, and click "edit" button, no response but the js error "Uncaught TypeError: Cannot read property 'i18n' of null".

    Can you link to the page showing the issue please, so I can debug it? My best guess at the moment is that TableTools might be getting loaded after Editor. It should be that TableTools is loaded before Editor.

    Allan

  • sschatsschat Posts: 3Questions: 1Answers: 0

    yes, i had the same issue... after loooong searching i found a 'trigger' to this

    it seems this error is related to the var name for declaring the editor.

        editor = new $.fn.dataTable.Editor({
    

    changing 'editor' to a different var will cause the error.

    no idea how to set it to a diff. var name yet, without running into this error again

  • sschatsschat Posts: 3Questions: 1Answers: 0

    ah yes! found it:

    in the declaration of the datatable itself, define the actual var-name for the editor

    tableTools: {
                sRowSelect: 'os',
                aButtons: [
                    {sExtends: "editor_create", editor: **your editor varname**},
                    {sExtends: "editor_edit", editor:**your editor varname**},
                    {sExtends: "editor_remove", editor: **your editor varname**}
                ]
            },
    
This discussion has been closed.