jQuery UI Widgets › Forums › Grid › JSON Parsing in Grid
Tagged: angular grid, array in cell, bind, data point, data source, grid, jquery grid, jqxgrid, json, multiple data points in cell
This topic contains 1 reply, has 2 voices, and was last updated by Dimitar 9 years, 1 month ago.
-
AuthorJSON Parsing in Grid Posts
-
How do I map below JSON ” indocs ” to single cell in the grid, sometimes it has just one object and sometimes it has array of objects? Thanks for your help!
{
“searchresult”: {
“order”: [
{
“shipdocs”: {
“ship”: {
“id”: 558743,
“docid”: “CPR845367829”,
“date”: “2015-07-16 00:00:00.0”
}
},“indocs”: {
“invoice”: {
“id”: 558217,
“inno”: 5179747,
“date”: “2015-07-16 00:00:00.0”
}
},
“inflag”: 0
},
{
“shipdocs”: {
“ship”: {
“id”: 558744,
“docid”: “CPR845367830”,
“date”: “2015-07-19 00:00:00.0”
}
},“indocs”: {
“invoice”: [
{
“id”: 558217,
“inno”: 5179747,
“date”: “2015-07-17 00:00:00.0”
},
{
“id”: 558217,
“inno”: 5179748,
“date”: “2015-07-17 00:00:00.0”
}
]
},
“inflag”: 0
}
}
}Hello prbvnky,
Only one data point from the data source can correspond to one grid cell. However, flat arrays can be displayed in cells (example), so if you change your source to:
{ "searchresult": { "order": [ { "shipdocs": { "ship": { "id": 558743, "docid": "CPR845367829", "date": "2015-07-16 00:00:00.0" } }, "indocs": { "invoice": { "id": 558217, "inno": 5179747, "date": "2015-07-16 00:00:00.0" } }, "inflag": 0 }, { "shipdocs": { "ship": { "id": 558744, "docid": "CPR845367830", "date": "2015-07-19 00:00:00.0" } }, "indocs": { "invoice": [ { "id": 558217, "inno": [ 5179747, 5179748 ], "date": "2015-07-17 00:00:00.0" } ] }, "inflag": 0 } ] } }
you may be able to bind all invoice inno data to a cell.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.