Selects from a set of predefined sorting definitions and directions.

Sorting Picker

Basic Usage

<adf-sorting-picker
    [options]="options"
    [selected]="value"
    [ascending]="ascending"
    (change)="onChanged($event)">
</adf-sorting-picker>

Class members

Properties

NameTypeDefault valueDescription
ascendingbooleantrueCurrent sorting direction
optionsArray<Function>[]Available sorting options
selectedstringCurrently selected option key

Events

NameTypeDescription
sortingChangeEventEmitter<boolean>Raised each time direction gets changed.
valueChangeEventEmitter<string>Raised each time sorting key gets changed.

Details

The picker shows the user a menu of sorting options (which could be data columns to sort on alphabetical vs numerical search, etc) and the choice of ascending vs descending sort order. Note that picker only implements the menu, so you are responsible for implementing the sorting options yourself.

The options property contains an array of any objects that expose the following properties:

{
    key: string;
    label: string;
}

The key is an identifying value and the label is the text that the user will see in the picker. The selected key is reported by the change event, which passes an object like the following as its parameter:

{
    key: string,
    ascending: boolean
}

© 2023 Alfresco Software, Inc. All Rights Reserved.