sort
Defines the sortable property and behavior.
set.props.sort(prop, [sortFunc])
Defines the sortable property and behavior.
var algebra = new set.Algebra(set.props.sort("sortBy"));
algebra.index(
{sortBy: "name desc"},
[{name: "Meyer"}],
{name: "Adams"}) //-> 1
algebra.index(
{sortBy: "name"},
[{name: "Meyer"}],
{name: "Adams"}) //-> 0
Parameters
- prop
{String}
:The sortable property.
- sortFunc
{function(sortPropValue, item1, item2)}
:The sortable behavior. The default behavior assumes the sort property value looks like
PROPERTY DIRECTION
(ex:name desc
).