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.

  1. {
  2. "results": [{
  3. "date": "7. Jul",
  4. "flightNumber": "FI384",
  5. "airline": "Icelandair",
  6. "to": "Gothenburg",
  7. "plannedDeparture": "00:30",
  8. "realDeparture": "Departed 00:28",
  9. "status": null
  10. }, {
  11. "date": "7. Jul",
  12. "flightNumber": "4U8213",
  13. "airline": "Eurowings",
  14. "to": "Berlin Tegel",
  15. "plannedDeparture": "00:35",
  16. "realDeparture": "Departed 00:54",
  17. "status": null
  18. }, {
  19. "date": "7. Jul",
  20. "flightNumber": "OK461",
  21. "airline": "Czech Airlines",
  22. "to": "Prague",
  23. "plannedDeparture": "00:40",
  24. "realDeparture": "Departed 00:55",
  25. "status": null
  26. }, ...
  27. ]
  28. }

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.