No results in table in MVC project

No results in table in MVC project

saurav1234saurav1234 Posts: 2Questions: 2Answers: 0
edited November 2016 in Free community support

I am using the Datatables plugin for JQuery in my ASP.NET MVC project. Currently, my controller gets the data from SQL Server and converts it to a JsonResult but I don't think I'm passing it to the javascript portion correctly. The table is generated but there are no rows. There is only 1 row saying "No matching records found". if the code below doesnt show up clearly, please refer to http://stackoverflow.com/questions/40896772/no-results-in-jquery-datatable-in-mvc-project

$(document).ready(function () {
$('#TableId').DataTable(
{
"columnDefs": [
{ "width": "5%", "targets": [0] },
{ "className": "text-center custom-middle-align", "targets": [0, 1, 2, 3, 4, 5] }
],
"language":
{
"processing": "

Processing...

"
},
"processing": true,
"serverSide": true,
"ajax":
{
"url": "/Home/GetData",
"type": "POST",
"dataType": "JSON",
"dataSrc": ""
},
"columns": [
{ "data": "AssetName" },
{ "data": "ErrorName" }
]
});
});

Asset Name Error Name
This discussion has been closed.