nested data with ArrayReader
Hi all,
ExtJS 4 certainly makes it easy to read nested data into associated data stores/models. However, is it at all possible to read nested data using ArrayReader only? Note, I am referring to a data structure wholly composed of nested arrays - no objects - so as to conserve the bandwidth taken by repeating JSON object titles.
An example of such data would be:
Code:
[
['North America', [
['United States',
['Alabama', 'Alaska', 'Arizona', ...]
],
['Canada',
['Alberta', 'British Columbia', 'Manitoba', ...]
], ...
],
['Central America',
['Mexico',
['Aguascalientes', 'Baja California', 'Baja California Sur', ...]
], ...
], ...
]
I'd appreciate any insight.
Thanks,
Kniget
consuming array from a JSON object
Deister,
You can consume an array from a JSON object by defining (in the store or model intended to receive the JSON object) a hasMany association to the array, and providing the association with a storeConfig to an ArrayReader, like so:
Code:
hasMany: {model: '[name of model for a single array record]', name: '[name of array in the JSON object]', storeConfig: {reader: {type: 'array'}}}
That still leaves my original question open: is it possible to consume nested arrays?
Kniget