i am using a data table to show user data but it says jQuery.Deferred exception: $(...).DataTable is

i am using a data table to show user data but it says jQuery.Deferred exception: $(...).DataTable is

pihupihu Posts: 2Questions: 1Answers: 0

$(document).ready(function () {
var oTable = $('#myDatatable').DataTable({
"ajax": {
"url": '/home/Getuser',
"type": "get",
"datatype":"json"
},
"columns": [
{ "data": "name", "autowidth": true },
{ "data": "emailID", "autowidth": true },
{ "data": "mobileNo", "autowidth": true },
{ "data": "fullName", "autowidth": true },
]
})
// $('#myDatatable').HTML();
})

Answers

  • pihupihu Posts: 2Questions: 1Answers: 0

    i am new to asp.mvc 4 any one can help mi to sort out this

  • kthorngrenkthorngren Posts: 21,352Questions: 26Answers: 4,955

    I'm not familiar with your environment and not able to see the full message but it sounds like the message is saying datatables is not a function. Is this correct?

    If so it sounds like the datatables JS includes aren't being loaded.

    Kevin

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

    Or jQuery is being loaded multiple times. jQuery will overwrite itself if that is done, taking any old plug-ins with it. Load jQuery only once.

    Allan

This discussion has been closed.