I'm having an issue with a REST call that's giving me some headaches. This is the code I'm using:
function LoadAIP(state)
{
var call = $.ajax({
url: "https://xxxx/xxxx/_vti_bin/listdata.svc/AIPList?
$select=ROCode,AIP,NotificationDate&$filter=(ROCode eq '"+state+"')&$top=5000",
type: "GET",
dataType: "json",
headers: {
Accept: "application/json;odata=verbose"
}
});
call.done(function (data,textStatus, jqXHR){
$('#example').dataTable( {
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaData": data.d.results,
"aoColumns": [
{ "mData": "ROCode" },
{ "mData": "AIP" },
{ "mData": "NotificationDate" }],"bRetrieve": true,
"sDom": '<"H"Tfr>t<"F"ip>',
"oTableTools": {
"aButtons": [ "xls"],
"sSwfPath": ../js/datatables/TableTools/media/swf/copy_csv_xls_pdf.swf",
"bFilter": true}
} );
});
call.fail(function (jqXHR,textStatus,errorThrown){
alert("Error retrieving Tasks: " + jqXHR.responseText);
});
}
It works except with one of the columns (NotificationDate). This field, as the name says it it a date field. When I make the call instead of showing a date, as would expect, it shows something else. For example, one of the rows it should show 4/9/2014, but instead shows this: /Date(1397001600000)/. I had a similar problem some time ago with XSLT and I used the ddwrt:DateTimeTick function to fix it in a Data view web part, but in this case I don't know what to do. Thanks!