Home Reference Source
import {SortableStoreBehavior} from './src/behaviors/sortable-store.js'
public class | source

SortableStoreBehavior

Extends:

src/behaviors/behavior~Behavior → SortableStoreBehavior

Constructor Summary

Public Constructor
public

constructor(instance: *, objectPattern1: {"collection": *})

Member Summary

Public Members
public get

$filter: *

public
public get
public get

Method Summary

Public Methods
public

onSortChange(expression: String/Array/Boolean)

This is a handler proxy for the Store.
public

Public Constructors

public constructor(instance: *, objectPattern1: {"collection": *}) source

Params:

NameTypeAttributeDescription
instance *
objectPattern1 {"collection": *}
  • optional
  • default: {}

Public Members

public get $filter: * source

public collection: * source

public get transformableCollection: * source

public get transformer: * source

Public Methods

public onSortChange(expression: String/Array/Boolean) source

This is a handler proxy for the Store. It get's called with the payload of the ENTITY_SORT_CHANGE action.

Params:

NameTypeAttributeDescription
expression String/Array/Boolean

This can be any valid angular orderBy $filter expression, or a reverse boolean if the collection we are sorting contains primitives.

Valid angular orderBy $filter expressions are

  • function: Getter function. The result of this function will be sorted using the <, ===, > operator.
  • string: An Angular expression. The result of this expression is used to compare elements (for example name to sort by a property called name or name.substr(0, 3) to sort by 3 first characters of a property called name). The result of a constant expression is interpreted as a property name to be used in comparisons (for example "special name" to sort object by the value of their special name property). An expression can be optionally prefixed with + or - to control ascending or descending sort order (for example, +name or -name). If no property is provided, (e.g. '+') then the array element itself is used to compare where sorting.
  • Array: An array of string predicates. The first predicate in the array is used for sorting, but when two items are equivalent, the next predicate is used.

public onSortClear() source