You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where I need to add more json data to my grid from an external source.
The issue is that every time I execute "addRowData" the rows are empty for all the columns that do not have a a formatter.
The JSON I need to consume has several nested fields, here is an example like the field "countryInfo"
var data = [
{ continent: "Africa", countryInfo: {name: "Congo", rank: 5, populationCount: 9999 }},
{ continent: "Africa", countryInfo: {name: "Ghana", rank: 3, populationCount: 9999 }},
{ continent: "Europe", countryInfo: {name: "Italy", rank: 1, populationCount: 9999 }},
{ continent: "Europe", countryInfo: {name: "France", rank: 2, populationCount: 9999 }},
];
I noticed that that if the if the json was flatten, then "addRowData" would work
var data = [
{ continent: "Africa", countryName: "Congo", rank: 5, populationCount: 9999},
{ continent: "Africa", countryName: "Ghana", rank: 3, populationCount: 9999 },
{ continent: "Europe", countryName: "Italy", rank: 1, populationCount: 9999 },
{ continent: "Europe", countryName: "France", rank: 2, populationCount: 9999 },
];
But I I have a lot of code consuming nested json depending on "addRowData" to work and change hundreds of reports. FYI this was working before in version 4.7.0
The text was updated successfully, but these errors were encountered:
I have a use case where I need to add more json data to my grid from an external source.
The issue is that every time I execute "addRowData" the rows are empty for all the columns that do not have a a formatter.
Here is an example not working for version 4.15.5
https://jsfiddle.net/dsmvy47n/1/
The JSON I need to consume has several nested fields, here is an example like the field "countryInfo"
var data = [
{ continent: "Africa", countryInfo: {name: "Congo", rank: 5, populationCount: 9999 }},
{ continent: "Africa", countryInfo: {name: "Ghana", rank: 3, populationCount: 9999 }},
{ continent: "Europe", countryInfo: {name: "Italy", rank: 1, populationCount: 9999 }},
{ continent: "Europe", countryInfo: {name: "France", rank: 2, populationCount: 9999 }},
];
var colModel = [
{ name: "continent" },
{ name: "countryInfo.name", label: "contry"},
{ name: "countryInfo.rank", label: "rank"},
{ name: "countryInfo.population", formatter: populationFormatter}
];
I noticed that that if the if the json was flatten, then "addRowData" would work
var data = [
{ continent: "Africa", countryName: "Congo", rank: 5, populationCount: 9999},
{ continent: "Africa", countryName: "Ghana", rank: 3, populationCount: 9999 },
{ continent: "Europe", countryName: "Italy", rank: 1, populationCount: 9999 },
{ continent: "Europe", countryName: "France", rank: 2, populationCount: 9999 },
];
var colModel = [
{ name: "continent" },
{ name: "countryName", label: "contry"},
{ name: "rank", label: "rank"},
{ name: "population", formatter: populationFormatter}
];
But I I have a lot of code consuming nested json depending on "addRowData" to work and change hundreds of reports. FYI this was working before in version 4.7.0
The text was updated successfully, but these errors were encountered: