What is the correct way to populate a store (that will be providing data to a grid view) from multiple similar (but not identical) JSON sources?
On the server side (that I do not directly control and thus cannot 'fix') there are three endpoints providing JSON data via ajax to my client.
The client is a simple grid panel that has ~15 columns.
Each of the three different data source (yes, all from same domain) provide records with (more than) these 15 fields. However, here are the differences among them:
- Each datasource will have a different mapping for some of the fields (the structure of the JSON is not the same)
- Each datasource will have a different root and record specification for the JSON Reader
- Each datasource will (obviously) have a different url
I could handle the first two issues by adding custom 'convert' functions to each field that differs across sources, however, I don't know how to solve the third issue (different URLs). Also, this does not seem ideal.
I imagine this isn't quite a one-off situation (multiple similar but non-identical data-sources that all provide data that should be combined in the same store, and, more importantly, displayed in the same grid).
Has anybody run across this before? If so, have you solved it? Is there a recommended approach?
Am I approaching this wrong? Is there another way to add the data provided from several different JSON sources within the same grid?