Skip to main content

SortByRule

Only a single sortBy rule can be active at one time. If any sortBy rules are provided and no specific rule is set, the first sortBy rule in the stack will be considered active.

Type Signature

sortByRule<FItem, FContext>({
id: string;
sortFn: FinderPropertySelector<FItem, FContext> | FinderPropertySelector<FItem, FContext>[];
defaultSortDirection?: SortDirection;
label?: string;
hidden?: boolean;
})
PropDescriptionDefaultRequired
idEvery sortBy rule must have a unique string id.
sortFnA callback that returns a string or number. It also receives context, which can be any arbitrary value passed into the Finder instance.
defaultSortDirection'asc' or 'desc'.'asc'
labelOptional label for your client to display.
hiddenOptional display value for your client to display.false