var table = new Tabulator("#baanrecords", {
ajaxConfig:{
mode: 'no-cors',
method:'GET',
credentials: 'same-origin',
headers: {
'Content-type': 'application/json; charset=UTF-8',
'Accept': 'application/json',
'X-Requested-With': 'XMLHttpRequest'
},
},
ajaxURL: 'https://spreadsheets.google.com/feeds/list/1Ze31_SUFd0ZyqeG1mt1qrEU61onnYhmI9mR1BC1pM7Y/od6/public/values?alt=json',
height:'400px',
layout:'fitColumns',
autoColumns:true,
placeholder:'De records worden geladen, een moment...',
index: 'onderdeelnaam',
columns:[
{title:"Onderdeel", field:"gsx$onderdeelnaam", sorter:"string", width:200},
{title:"Prestatie", field:"gsx$prestatie", sorter:"number", formatter:"progress"},
{title:"Eenheid", field:"gsx$prestatieeenheid", sorter:"string"},
{title:"Naam", field:"gsx$naam", sorter:"string", align:"left", width:100},
{title:"Categorie", field:"gsx$categorie", sorter:"string", sortable:true},
{title:"Datum", field:"gsx$datum", sorter:"date", align:"left"},
{title:"Plaats", field:"gsx$plaats", align:"right", sorter:"string"},
],
ajaxResponse:function(url, params, response){
//url - the URL of the request
//params - the parameters passed with the request
//response - the JSON object returned in the body of the response.
return response.entry; //return the tableData property of a response json object
},
});
table.setData("https://spreadsheets.google.com/feeds/list/1Ze31_SUFd0ZyqeG1mt1qrEU61onnYhmI9mR1BC1pM7Y/od6/public/values?alt=json");