Members
dirString
Type
-
String
Source
propertyString
Type
-
String
Source
Methods
static
asc(property) → {Sort}
Creates a new Sort instance that indicates an ascending sort order for the given property.
Parameters
-
property
StringThe property to be sorted.
Returns
Source
static
desc(property) → {Sort}
Creates a new Sort instance that indicates an descending sort order for the given property.
Parameters
-
property
StringThe property to be sorted.
Returns
Source
static
parse(input) → {Sort|Array.<module:sort~Sort>}
Returns a new Sort instance (or array of Sort instances from a string representation. If no
sorts are defined, a null is returned.
Parameters
-
input
StringThe string to deconstruct.
Returns
-
SortArray.<module:sort~Sort>A single
Sortinstance when only one Sort is specifiedy, otherwise an array ofSortinstances is returned (in order).
Examples
let myOrderBy = Sort.parse('FirstName desc'); //returns a single Sort
let mySorts = Sort.parse('FirstName, LastName desc'); //returns array of Sort
Source
toString() → {String}
Returns a string representation of the sort property and direction. If the property is missing, then a blank string is returned.
Returns
-
String