I've got "nested" json data that I'm attaching as local data to the datasource of a grid. Each row has some normal "flat" values (like "rowID"), and also "keyedInfo" array, which in turn is also an array (keys like "key1" and "key2") where one attribute of each element ("theVal") is of interest for displaying as a grid column. I've got a simple example in the dojo:
I'm never to sure how much support the DataSource has for nested data, but by specifying "keyedInfo: {}" in the dataSource fields definition, this mostly works! I can specify "keyedInfo['key1'].theVal" as an entry in the grid's "columns" definition, and it displays the appropriate value from the data. I can also, as expected, do aggregate totals of the flat attributes (like "count" on rowID). However, there doesn't seem to be any way to aggregate the columns that are from the nested values.
I have {field: "keyedInfo['key1'].theVal, aggregate: "sum"} entries in the dataSource aggregate definition, and it doesn't raise any errors, so it is either being ignored or actually calculating the aggregate. But a footerTemplate of "#=sum# for these sorts of columns raises a Javascript error that "sum" isn't defined (uncomment one of them in the dojo example to see this). Is there any chance that the aggregate has been calculated and I just need a more complex reference in the template?
If not, is there any hope that support might get extended to this case? I suspect that the lack of definition support in the "schema" may be preventing the aggregate from having a way to refer/store the desired aggregate, but it would be very nifty if a way could be found - flattening the data source will be a pain.