`<data:repeater>`
</...>
Repeaters are similar to a foreach loop.
Allows iteration over a set of data, rendering HTML.
Related Tutorials
Content
any
Defines the template for each repetition of the repeater. Access the datasource content through the variable named in the as attribute to render the content in the datasource.
Attributes
- `as`
string
The name of the variable to be registered for each row. For example, as="myvar" will let you reference $myvar inside the control.
- `classRow`
string
The CSS class for rows (<tr> tags).
- `dataGroupBy`
array
An array of fields to group by, if
datasource is a function that supports a
Query Array.
- `dataJoins`
array
Array of tables to join with, if
datasource is a function that supports a
Query Array.
- `dataLimit`
int
The maximum number of results to return, if
datasource is a function that supports a
Query Array.
- `dataOrder`
array
Sets the order by which the data is sorted
The parameter is a two-dimensional array consisting of column names and the direction of the order.
For example, the following would sort contacts by their last name ascending and in the event of two contacts having the same last name, their first name descending
[['contact_last_name', 'asc'], ['contact_first_name', 'desc']]
- `dataSearch`
string
Filter results to match those found by this search query.
Typically used with a
<forms:searchbox id="searchbox" /> in an
ajax:region.
Eg:
datasearch="[? $searchbox.getValue() ?]"
Note: The
datasource must support a
Query Array.
- `dataSourceSupportsOrdering`
bool
Sets whether the DataSource supports the order parameter.
When set to true, an order parameter will be appended to the data. The order parameter is an array containing values similar to: [['contact_id', 'desc'], ...].
- `dataSourceSupportsPaging`
bool
Sets whether the DataSource supports the paging parameters.
When set to true, two parameters will be appended to the call to the DataSource which represent the start and limit values of pagination.
- `dataStart`
int
The number of results to skip, if
datasource is a function that supports a
Query Array.
- `emptyMessage`
string
The message shown when there are no rows in the data control.
- `exportable`
bool|string
If true, an 'Export Data' link will appear beneath the control which will save a CSV file to the client of all the data in the control. Default = false.
- `height`
string
Height
Sets the height of the element. The default units are pixels. include the percentage symbol % to user percentage values.
- `id`
string
Give this control a unique id. Can be accessed in the client DOM (eg, document.getElementById('myid') or in the server DOM using [? $myid ?] or [? $('myid') ?]).
- `keyAs`
string
The name of the variable to be registered for each row's key.
For arrays of entities from the database (for example getAll()), the keys will be incrementing integers starting at 0.
- `paging`
bool
Whether to enable paging for this control. With paging enabled, the initial number of results will be limited to the value of pagingrows, and a 'Show More' button will appear.
Each click of the button will append pagingrows more rows. Default = false.
- `pagingRows`
int
Use in conjunction with paging, to control the initial number of rows to be shown, and the number of rows loaded when 'Show More' is clicked. Default = 25.
- `populateAt`
string
Sets when to populate from the datasource. Not required for most tasks, but can resolve timing issues on very complicated pages.
Default = 'init'. Other possible values: 'render'.
- `width`
string
Width
Sets the width of the element. The default units are pixels. include the percentage symbol % to user percentage values.
- `onPopulateServer`
callable
Called after the data control has populated from the datasource / component