Guide applies to: modern
What Is a Store
Backend web services normally send data as arrays of objects. ExtJS creates a record out of each object, and stores the full set in a store. A store is a collection of records.
Grids show one row per record in a store.
Here’s a Typical Feed
Here’s a typical feed. The array could be anywhere — in this case it’s in the results propery of the response object.
{
"results": [{
"date": "7. Jul",
"flightNumber": "FI384",
"airline": "Icelandair",
"to": "Gothenburg",
"plannedDeparture": "00:30",
"realDeparture": "Departed 00:28",
"status": null
}, {
"date": "7. Jul",
"flightNumber": "4U8213",
"airline": "Eurowings",
"to": "Berlin Tegel",
"plannedDeparture": "00:35",
"realDeparture": "Departed 00:54",
"status": null
}, {
"date": "7. Jul",
"flightNumber": "OK461",
"airline": "Czech Airlines",
"to": "Prague",
"plannedDeparture": "00:40",
"realDeparture": "Departed 00:55",
"status": null
}, ...
]
}
Why Not Just Use the Array Itself?
- Records add a lot of features, such as data conversion and validation.
- Stores add a lot of features, such as sorting, filtering, and grouping.
The conversion of the data feed into records and stores is automatic. And its easy to convert an array to a store, or to access the original feed data.