Uncaught TypeError: n[v] is undefined when trying to display more than 4 columns

Uncaught TypeError: n[v] is undefined when trying to display more than 4 columns

bonaventurebonaventure Posts: 15Questions: 7Answers: 0
edited December 2020 in Free community support

Link to test case:

Debugger code (debug.datatables.net):

Error messages shown:

Uncaught TypeError: n[v] is undefined
    Xa http://localhost:8888/js/datatables.min.js:91
    za http://localhost:8888/js/datatables.min.js:77
    success http://localhost:8888/js/datatables.min.js:118
    jQuery 6
    u http://localhost:8888/js/datatables.min.js:117
    jQuery 2
    u http://localhost:8888/js/datatables.min.js:112
    DataTable http://localhost:8888/js/datatables.min.js:196

Description of problem:
Following will not display, if I remove ANY arbitrary field, it will work.
(current version of Datatables and jQuery)

columns: [
                    {
                        data: 'availabilityIndicator', width: "50px"
                    },
                    {
                        data: 'name', width: "50px"
                    },
                    {
                        data: 'description', width: "100px"
                    },
                    {
                        data: 'startDate', type: 'datetime', width: "50px",
                        render: function (data, type, full) {
                            if (data === null || data === "") {
                                return data;
                            } else {
                                var options = {day: '2-digit', month: '2-digit', year: 'numeric'};
                                return new Date(data).toLocaleDateString(undefined, options);
                            }
                        }
                    },
                    {
                        data: 'endDate', type: 'datetime', width: "50px",
                        render: function (data, type, full) {
                            if (data === null || data === "") {
                                return data;
                            } else {
                                var options = {day: '2-digit', month: '2-digit', year: 'numeric'};
                                return new Date(data).toLocaleDateString(undefined, options);
                            }
                        }
                    }
                ]

Edited by Kevin:  Syntax highlighting. Details on how to highlight code using markdown can be found in this guide

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.