Perspective table data source

I’d like to show a db query’s result in a table.
How should I configure the data source of a table component?

This is a really loaded question, and is entirely dependent on what you want to display, as well as what you might want to do as far as styling individual rows or passing parameters to subviews.

If you just have a query and you want that query to display in a table, you just need to configure the binding - it’s really that simple.

If you want custom display options, you can get an idea of the structure by looking at the first data element of the default data in the Table component:

{
  "city": {
    "value": "Folsom",
    "editable": true,
    "style": {
      "backgroundColor": "#F7901D",
      "classes": "some-class"
    },
    "align": "center",
    "justify": "center"
  },
  "country": "United States",
  "population": 77271
}

If you’re going to do something like this, you’ll need to iterate over the returned data from the query and build your object as you see fit.

Got it, thanks.