Json Format
Json Format
Hi,
I have a json file lokks like :
[code]
[
{
"name":"Serveur",
"nom":
[
"name1",
"name2"
]
},
{
"name":"Horaire dépassé",
"nombre":
[
209,
197,
88,
57,
30,
24,
21,
17,
17,
15
]
}
]
[/code]
I can't modify this file. It was used for others stuff.
I unable to create datatable with this file .
I do several test without result :
[code]
$.getJSON('include/stats_top10_hd_month.json',function(data){
console.log(data) ;
var r = data ;
console.log(r[0]["nom"])
$("#tab_top10_hd_month").dataTable({
"aaData" : r,
"bProcessing": true,
"aoColums": [
{"mData": "nom"},
{"mData": "nombre"}
]
})
}) ;
[/code]
Does someone can help me ?
PS: Sorry for my english .
I have a json file lokks like :
[code]
[
{
"name":"Serveur",
"nom":
[
"name1",
"name2"
]
},
{
"name":"Horaire dépassé",
"nombre":
[
209,
197,
88,
57,
30,
24,
21,
17,
17,
15
]
}
]
[/code]
I can't modify this file. It was used for others stuff.
I unable to create datatable with this file .
I do several test without result :
[code]
$.getJSON('include/stats_top10_hd_month.json',function(data){
console.log(data) ;
var r = data ;
console.log(r[0]["nom"])
$("#tab_top10_hd_month").dataTable({
"aaData" : r,
"bProcessing": true,
"aoColums": [
{"mData": "nom"},
{"mData": "nombre"}
]
})
}) ;
[/code]
Does someone can help me ?
PS: Sorry for my english .
This discussion has been closed.
Replies
Allan
[code]
{
"nom": ...,
"nombre": ...
}
[/code]
Allan
That is . I would a table with columns "Nom" and "Nombre" .
But I don't know how i have to do.
I think i need convert but i don't know what exactly and how .
thx
[code]
var a = [];
for ( var i=0, ien=d[0].nom.length ; i
It's good for me .
This format is used for draw several graphs with highcharts.