$(document).ready(function() { loadItems(); }); function loadItems() { var call = $.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('Infoboard')/items?$top=1000&$select=Prio,type,description,ETA", type: "GET", dataType: "json", headers: { Accept: "application/json;odata=verbose" } }); call.done(function (data,textStatus, jqXHR){ $('#Infoboard').dataTable({ "createdRow": function(row, data, dataIndex) { if ( data[0] == "P1" ) { $(row).addClass('red'); } }, "bPaginate": true, "bJQueryUI" : true, "bDestroy": true, "bProcessing": true, "deferLoading": [500], "aaData": data.d.results, "aoColumns": [ { "mData": "Prio" }, { "mData": "type" }, { "mData": "description" }, { "mData": "ETA" } ] }); }); call.fail(function (jqXHR,textStatus,errorThrown) { alert("Error retrieving Tasks: " + jqXHR.responseText); }); }