Try loading as AMD module or fall back to default loading
The actual widget class
Default options for the widget
triggers
: a selector pointing to the sort triggersitems
: a selector pointing to the itemsInitializer function.
Add aria attributes
Attach evenets to the widget
Sort the items
Find the widget structure using the specified configuration
Find the sorting triggers, specified in one of the following ways:
data-role="sort-trigger"
triggers
option, specified as a selectorthead th
, if the widget contains a tableFind the sort items, specified in one of the following ways:
data-role="sort-item"
items
option, specified as a selectortbody tr
, if the widget contains a tableli
, if the widget contains a listGet the selector for a specific item. Its value will be used for the comparison instead of that of the item.
data-selector
on the sort-trigger
td
with the same index as the th
in the context of a table
Get the data type to use for a specific trigger
Get sort order
Cleanup the widget and remove remaining references
Install the widget into the JS library
Sort
The
Sort
class provides a sorting widget.author: Julien Ramboz version: 1.0 usage: Sort examples