deferloading is throwing error: "Unable to set property 'data' of undefined or null reference."

deferloading is throwing error: "Unable to set property 'data' of undefined or null reference."

helmiforthelmifort Posts: 3Questions: 2Answers: 0

I am using SharePoint Search API to search SharePoint lists and using jquery datatables to display the data. So getting the first 100 items/results is fine and they are diplayed without any problems.

However, the Search API returns a total of 2100 results, but the row limit is set to 100.
I wanted to get the next load of data and I tried to use serverSide:true and deferloading, but I am getting an error:

"DataTables warning: table id=example - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1"

and in the code is this this error: "Unable to set property 'data' of undefined or null reference."

Why the JSON is invalid since the table is loading with data on page load? This error occurs when I click on next button or another page. Any help will be much appreciated.

var oTable = $('#articlesOverview').DataTable({ //"iDisplayLength": 25, "bDestroy": true, "bProcessing":true, //"serverSide": true, //"deferLoading": totalRows, "aaData":results.m_value.ResultTables[0].ResultRows, "aoColumns":[ { "mData":"Title", "render": function ( mData, type,row, meta ) { return '<a href="' + removeLastSlash(row.Path) + '">' + mData+'</a>'; } } ] });

Answers

This discussion has been closed.