Interface SortOptions

Possible values for Wunderbaum.sort and WunderbaumNode.sort options argument.

interface SortOptions {
    caseInsensitive?: boolean;
    cmp?: SortCallback;
    colId?: string;
    deep?: boolean;
    key?: SortKeyCallback;
    nativeOrderPropName?: string;
    order?: SortOrderType;
    propName?: string;
    updateColInfo?: boolean;
}

Properties

caseInsensitive?: boolean

Sort string values case insensitive.

false

Callback that determines the order.

use key instead

colId?: string

Column ID as defined in tree.columns definition. Required if updateColInfo is true.

deep?: boolean

Sort descendants recursively.

true

Callback that determines a node representation for comparison.

common.nodeTitleKeyGetter

nativeOrderPropName?: string

Sort by this property if order is undefined. See also WunderbaumNode.resetNativeChildOrder.

_nativeIndex.

Sort order 'asc' or 'desc'.

'asc' (or if updateColInfo is true, the rotated status of the column definition. See also WunderbaumOptions.sortFoldersFirst.

propName?: string

The name of the node property that will be used for sorting. Mandatory, unless key or colId are given.

updateColInfo?: boolean

Rotate sort order (asc -> desc -> none) before sorting. Update the sort icons in the column header Note: Sorting is done in-place. There is no 'unsorted' state, but we can call setCurrentSortOrder() to renumber the node._sortIdx property, which will be used as sort key, when order is undefined.

false