<vaadin-grid-sort-column>
helper element can be used to define sorting for a column
in the most simple case, where the header cell should render a text label and a sorting indicator,
while the body cells are only expected to render values of a sorting property.
Only the path
property is mandatory to make the sorting work. The header
property is
optional and can be omitted, in that case the header text will be generated based on the path
value.
NOTE: You must explicitly import the vaadin-grid-sort-column
in order to use it.
<vaadin-grid-sorter>
together with a renderer
can be used to enable
sorting for any type of column. The users in the example are sorted by last name initially.
NOTE: You must explicitly import the vaadin-grid-sorter
in order to use it.
When the data is fetched from a data provider, the responsibility
of providing the correctly ordered data is on the data provider itself.
The data provider is asked for fresh sorted data whenever the sorting
order is changed on any <vaadin-grid-sorter>
.
The effective sortOrders
array will be included as one of
the data provider call options.
Hint: When using a data provider, path
on the
<vaadin-grid-sorter>
element can be set to any string,
instead of a property on the item object.