Type Definitions
-
criterium
-
A criterium is a combination of the selector, the options and the default options
Type:
- Object
- Source:
Properties:
Name Type Description selectorString a valid CSS selector
orderString order: asc, desc or rand
attrString order by attribute value
dataString use the data attribute for sorting
useValBoolean use element value instead of text
placeString place ordered elements at position: start, end, org (original position), first
returnsBoolean return all elements or only the sorted ones (true/false)
casesBoolean a case sensitive sort orders [aB,aa,ab,bb]
naturalBoolean use natural sort order
forceStringsBoolean if false the string '2' will sort with the value 2, not the string '2'
ignoreDashesBoolean ignores dashes when looking for numerals
sortFunctionfunction override the default sort function
hasSelectorboolean options has a selector
hasFilterboolean options has a filter
hasAttrboolean options has an attribute selector
hasDataboolean options has a data selector
sortReturnNumbernumber the sort function return number determined by options.order
-
elementObject
-
The element object.
Type:
- Object
- Source:
Properties:
Name Type Description elmHTMLElement The element
posnumber original position
posnnumber original position on the partial list
-
options
-
Options object
Type:
- Object
- Source:
Properties:
Name Type Argument Default Description selectorString <optional>
A CSS selector to select the element to sort to.
orderString <optional>
'asc' The order of the sorting method. Possible values are 'asc', 'desc' and 'rand'.
attrString <optional>
null Order by attribute value (ie title, href, class)
dataString <optional>
null Use the data attribute for sorting.
placeString <optional>
'org' Determines the placement of the ordered elements in respect to the unordered elements. Possible values 'start', 'end', 'first', 'last' or 'org'.
useValBoolean <optional>
false Use element value instead of text.
casesBoolean <optional>
false A case sensitive sort (orders [aB,aa,ab,bb])
naturalBoolean <optional>
false Use natural sort order.
forceStringsBoolean <optional>
false If false the string '2' will sort with the value 2, not the string '2'.
ignoreDashesBoolean <optional>
false Ignores dashes when looking for numerals.
sortFunctionfunction <optional>
null Override the default sort function. The parameters are of a type {elementObject}.
useFlexBoolean <optional>
true If one parent and display flex, ordering is done by CSS (instead of DOM)
emptyEndBoolean <optional>
true Sort empty values to the end instead of the start