Json to DataTable
Json to DataTable
Неllo!
I have a json data like this:
{
"name": 4,
"value": 10,
"children": [
{
"name": 40,
"value": 20,
"children": []
},
{
"name": 45,
"value": 50,
"children": []
},
{
"name": 47,
"value": 10,
"children": [
{
"name": 270,
"value": 30,
"children": []
},
{
"name": 358,
"value": 20,
"children": []
},
{
"name": 359,
"value": 10,
"children": []
}
]
}
]
}
I need a data table like this:
Answers
According to jsonlint your json is invalid.
Also you need to supply more detail about your requirements.
What is the significance of the indentation in your "name" field?
How far have you got with your DataTable?
@tangerine thanks, i fix my json.
The significance of the indentation in "name" field i can make with render function, and it isn't a problem(the value of the significance of the indentation is 4   tags multiply by level of item)
I only want to know how display json data in DataTable.
Thanks!
How far have you got?
There are plenty of simple examples to follow.