Comment intégrer dans datatables api football-data.org
Comment intégrer dans datatables api football-data.org

Bonjour,
Je ne parviens pas à intégrer ce json dans datatables. J'ai essayé toute les examples relatifs aux objects json, api rest, sans succès.
Je récupère bien le fichier, mais coince sur son traitement pour l'inclusion des datas dans les colonnes.
Doit-il être parser avant cette inclusion ?
Merci par avance pour votre aide
Fichier json.
{
"id": 2003,
"area": {
"id": 2163,
"name": "Netherlands"
},
"name": "Eredivisie",
"code": null,
"plan": "TIER_ONE",
"currentSeason": {
"id": 4,
"startDate": "2017-08-11T19:00:00Z",
"endDate": "2018-05-20T16:45:00Z",
"currentMatchday": 34
},
"seasons": [
{
"id": 4,
"startDate": "2017-08-11T19:00:00Z",
"endDate": "2018-05-20T16:45:00Z",
"currentMatchday": 34
}
],
"lastUpdated": "2018-06-05T00:17:50Z"
}
This question has an accepted answers - jump to answer
Answers
How are you trying to add this data?
If using
ajax
ordata
orrows.add()
the JSON data needs to be in an array even if its just one record.Maybe you can post your Datatables initialization code.
Looks like you have some nested objects. This example may help:
https://datatables.net/examples/ajax/deep.html
Click on the
ajax
tab to see the original source data.Kevin
Thnak you for the response. It works finally.