Global

Type Definitions

criterium

A criterium is a combination of the selector, the options and the default options

Type:
  • Object
Properties:
Name Type Description
selector String

a valid CSS selector

order String

order: asc, desc or rand

attr String

order by attribute value

data String

use the data attribute for sorting

useVal Boolean

use element value instead of text

place String

place ordered elements at position: start, end, org (original position), first

returns Boolean

return all elements or only the sorted ones (true/false)

cases Boolean

a case sensitive sort orders [aB,aa,ab,bb]

natural Boolean

use natural sort order

forceStrings Boolean

if false the string '2' will sort with the value 2, not the string '2'

ignoreDashes Boolean

ignores dashes when looking for numerals

sortFunction function

override the default sort function

hasSelector boolean

options has a selector

hasFilter boolean

options has a filter

hasAttr boolean

options has an attribute selector

hasData boolean

options has a data selector

sortReturnNumber number

the sort function return number determined by options.order

elementObject

The element object.

Type:
  • Object
Properties:
Name Type Description
elm HTMLElement

The element

pos number

original position

posn number

original position on the partial list

options

Options object

Type:
  • Object
Properties:
Name Type Argument Default Description
selector String <optional>

A CSS selector to select the element to sort to.

order String <optional>
'asc'

The order of the sorting method. Possible values are 'asc', 'desc' and 'rand'.

attr String <optional>
null

Order by attribute value (ie title, href, class)

data String <optional>
null

Use the data attribute for sorting.

place String <optional>
'org'

Determines the placement of the ordered elements in respect to the unordered elements. Possible values 'start', 'end', 'first', 'last' or 'org'.

useVal Boolean <optional>
false

Use element value instead of text.

cases Boolean <optional>
false

A case sensitive sort (orders [aB,aa,ab,bb])

natural Boolean <optional>
false

Use natural sort order.

forceStrings Boolean <optional>
false

If false the string '2' will sort with the value 2, not the string '2'.

ignoreDashes Boolean <optional>
false

Ignores dashes when looking for numerals.

sortFunction function <optional>
null

Override the default sort function. The parameters are of a type {elementObject}.

useFlex Boolean <optional>
true

If one parent and display flex, ordering is done by CSS (instead of DOM)

emptyEnd Boolean <optional>
true

Sort empty values to the end instead of the start