Error initializing in dataTable editor

Error initializing in dataTable editor

wipflashwipflash Posts: 1Questions: 1Answers: 0

I've been using curent dataTables.js for a while. Today I've added dataTables.editor.js and this line
editor = new $.fn.dataTable.Editor
({ results in Uncaught TypeError: $.fn.dataTable.Editor is not a function

Why won't it initialize?

My complete code block

$(document).ready(function() {
            var editor = new $.fn.dataTable.Editor({
                "ajax": "/app/assign/designation-data/",
                "table": ".view-table",
                "fields": [{
                    "label": "Designation:",
                    "name": "designation"
                }, {
                    "label": "Description:",
                    "name": "description"
                }, {
                    "name": "id",
                    "type": "hidden"
                }
                ]
            });
            var table = $('.view-table').DataTable({
                "processing": true,
                "pageLength": 5,
                "ajax": "/app/assign/designation-data/",
                rowId: 'id',
                "columns": [
                    {"data": "designationContractorName",},
                    {
                        "data": null,
                        "targets": -1,
                        className: "actions",
                        "defaultContent": '<a href="" class="editor_edit">Edit</a> / <a href="" class="editor_remove">Delete</a>'
                    }
                ]
            });
        });

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    That error suggests that the Editor script hasn't been loaded. Are there any other errors shown in your browser's console? Are you able to give me a link to the page showing the issue?

    Thanks,
    Allan

This discussion has been closed.