The sorter mixin is a post-processor mixin, compatible with list-mixin. It provides the ability to sort some resources, depending of the values of one of their properties.
The name of the field you want to use to order the list.
To sort in ascending, use
order-asc. To sort descending, use
In this example, the users list will be ordered alphabetically based on the username.<solid-display data-src="http://server/users/" fields="username" order-asc="username" ></solid-display>
If the attribute is present, the list will be shuffled before being displayed<solid-display data-src="http://server/users/" fields="username" order-by-random ></solid-display>
Available from version 0.16
<solid-form-search>used to provide several options for the user to sort current list of resource.
<solid-form-search>must at least contain
Fieldattribute contains the fields of the resource to be offered to the user for sorting the data.
Orderattribute allows you to propose 2 sorting orders: ascending (
asc`) and descending (``desc). By default, the order is ascending.
example:<solid-form-search id="my-sorter" fields="field, order" enum-field="username, email" enum-order="ascending order = asc, descending order = desc" ></solid-form-search> <solid-display data-src="http://server/users" fields="username, last_name, email" sorted-by="my-sorter" ></solid-display>