Condensed Presentation
Note
See Condensed Data for explanation how condensed data handling works.
Note
Array references can not be used in Condensed Presentation templates.
Contains the definition how to present condensed_data
in table form.
Model
attribute | description |
---|---|
colgroups [ [unsigned_integer] ] |
Defines how should the columns be visually grouped together. Each number indicates a group where its value is the number of columns it spans. The sum of all the numbers in the array must therefore be equal to the total number of columns in the table. The groups are created in the direction of text. |
thead* [[Header Cell]] |
Defines the header of the table. It is an array of rows and each row is an array of cells. |
row_set_template* [[Data Cell]] |
Defines template used to render the individual records. It is an array of rows and each row is an array of cells. That means that one record can span over multiple rows. Each record must use the same template. |
Header Cell
attribute | description |
---|---|
isHeaderbool |
Indicates if the cell is a header |
content* string |
Defines the value to display |
colspan |
Indicates how many columns should the cell span |
rowspan |
Indicates how many rows should the cell span |
filters[filter] |
Filters to be applied to the value displayed |
Data Cell
Either data
or content
attributes must be present, but not both.
attribute | description |
---|---|
isHeaderbool |
Indicates if the cell is a header |
datacdid |
Pointer to the data to be displayed within the given record in condensed_data |
contentstring |
Defines the value to display |
colspan |
Indicates how many columns should the cell span |
rowspan |
Indicates how many rows should the cell span |
filters[filter] |
Filters to be applied to the value displayed |
Example
{
"colgroups": [2, 2],
"thead": [
[
{ "rowspan": 2, "colspan": 2 },
{ "isHeader": true, "colspan": 2, "content": "cars.availability", "filters": ["translate"]}
],
[
{ "isHeader": true, "content": "$" },
{ "isHeader": true, "content": "cars.inStock", "filters": ["translate"] }
]
],
"row_set_template": [
[
{ "isHeader": true, "rowspan": 2, "data": ".0" },
{ "isHeader": true, "content": "cars.wagon", "filters": ["translate"] },
{ "data": ".1.1.0" },
{ "data": ".1.1.1", "filters": ["translate"] }
],
[
{ "isHeader": true, "content": "cars.sedan", "filters": ["translate"] },
{ "data": ".2.1.0" },
{ "data": ".2.1.1", "filters": ["translate"] }
]
]
}