Error occurs plz solve..

Error occurs plz solve..

Sujit1naleSujit1nale Posts: 1Questions: 0Answers: 0

I'm trying to implement CRUD operation using datatableseditor using Backbone, RequireJS and Datatables.But I'm getting the error message:

$.fn.dataTable.Editor is not a constructor":
why it occurs..what is the reason???

Here is my code...
var editor;
$(document).ready(function () {
editor = new $.fn.dataTable.Editor({
ajax: "/View/GetList",
table: "#sellertable",
fields: [{
label: "SELLER CODE:",
name: "Sellercode"
}, {
label: "EMAIL:",
name: "Email"
}, {
label: "MOBILE:",
name: "Mobile"
}, {
label: "ISACTIVE:",
name: "Isactive"
}

            ]
        });

        $('#sellertable').DataTable({

            ajax: {
               url: "/View/GetList",
                type: "POST",
                datatype: "json"
            },
            serverSide: true,
            columns: [
                { data:"Sellercode"},
                { data: "Email"  },
               { data: "Mobile" },
                { data: "Isactive" }

            ],
            select: true,

            buttons: [
                { extend: "create", editor: editor },
                { extend: "edit", editor: editor },
                { extend: "remove", editor: editor }
            ]
        });
    });

Replies

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    It sounds like the dataTables.editor.js file hasn't been included on your page. Have you downloaded the trial package and included Editor?

    Allan

  • sanjay123sanjay123 Posts: 2Questions: 0Answers: 0

    dataTables.editor.min.js:1 Uncaught ReferenceError: define is not defined
    at dataTables.editor.min.js:1
    at dataTables.editor.min.js:1
    (anonymous) @ dataTables.editor.min.js:1
    (anonymous) @ dataTables.editor.min.js:1
    editor.bootstrap.min.js:5 Uncaught TypeError: Cannot read property 'defaults' of undefined
    at editor.bootstrap.min.js:5
    at editor.bootstrap.min.js:5
    at editor.bootstrap.min.js:5
    (anonymous) @ editor.bootstrap.min.js:5
    (anonymous) @ editor.bootstrap.min.js:5
    (anonymous) @ editor.bootstrap.min.js:5
    jquery-3.3.1.js:3818 jQuery.Deferred exception: $.fn.dataTable.Editor is not a constructor TypeError: $.fn.dataTable.Editor is not a constructor
    at HTMLDocument.<anonymous> (http://localhost/ssp/demo:166:14)
    at mightThrow (https://code.jquery.com/jquery-3.3.1.js:3534:29)
    at process (https://code.jquery.com/jquery-3.3.1.js:3602:12) undefined
    jQuery.Deferred.exceptionHook @ jquery-3.3.1.js:3818
    process @ jquery-3.3.1.js:3606
    setTimeout (async)
    (anonymous) @ jquery-3.3.1.js:3640
    fire @ jquery-3.3.1.js:3268
    fireWith @ jquery-3.3.1.js:3398
    fire @ jquery-3.3.1.js:3406
    fire @ jquery-3.3.1.js:3268
    fireWith @ jquery-3.3.1.js:3398
    ready @ jquery-3.3.1.js:3878
    completed @ jquery-3.3.1.js:3888
    jquery-3.3.1.js:3827 Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
    at HTMLDocument.<anonymous> (demo:166)
    at mightThrow (jquery-3.3.1.js:3534)
    at process (jquery-3.3.1.js:3602)

    please help

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This thread here may help...

This discussion has been closed.