Trying to do server side processing with ajax & ReST.
Trying to do server side processing with ajax & ReST.
rkushner
Posts: 1Questions: 1Answers: 0
The error says 'data' is undefined. The debugger says HTML1506: Uexpected token. It was working when the ajax function called the DataTable function on success. Here's the code:
dataTableExample = $('#table_id').DataTable({
"processing": true,
"serverSide": true,
"ajax":{
url: oDataUrl,
type: "GET",
dataType: "json",
headers: {
"accept": "application/json;odata=verbose"}
},
"order": [[ 7, "desc" ]],
"aaData": data.d.results,
"aoColumns": [{
"mData": "ID",
"render": function(mData) {
return("<a href='"+_spPageContextInfo.webAbsoluteUrl+"/Lists/ExternalUserAccounts/ExtendExpiry.aspx?itemid=" + mData + "' class='edit-entry'><img src='../../SiteAssets/images/edit.png'></a>");
}
}, {
"mData": "Title"
This discussion has been closed.
Answers
That suggests to me that a syntax error was found while parsing the HTML page. Have you run the page through an HTML syntax checker?
Kevin
Why are you setting both
ajax
anddata
(the new form for the legacy aaData option)? They are either / or. To be honest, it doesn't really make sense to set them both together - you would either get the data from Ajax or from a local Javascript variable.Allan