Working with Multi-scenario Tables
By default, <vdl-table> displays data from the first scenario on the shelf. You can override this for the table or an individual column using the scenario attribute.
If a table references entities from multiple scenarios, data is used from the corresponding index sets(s) of all scenarios. If those index sets have associated label arrays, then labels are looked up across all of the scenarios used in the table, in the same order as they appear on the shelf.
In this example, data for
EntityOne and
EntityTwo is fetched from the 2
nd scenario on the shelf - this is due to the scenario="1" attribute of the
<vdl-table> element - recall that the array of scenarios in a model is zero-indexed. Data from
EntityThree is fetched from the 3
rd scenario. The index columns are a combination of the data from both the 2
nd and 3
rd scenarios on the shelf.
<vdl-table scenario="1"> <vdl-table-column entity="EntityOne"></vdl-table-column> <vdl-table-column entity="EntityTwo"></vdl-table-column> <vdl-table-column entity="EntityThree" scenario="2"></vdl-table-column> </vdl-table>