Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SortingsService

Provides sorting functionality.

note

This type is configured to use with FiltersService.

Hierarchy

  • SortingsService

Index

Properties

Protected defaultSortingsInternal

defaultSortingsInternal: SortParameter[] = new Array<SortParameter>()

Internal implementation of defaultSortings.

sortings

sortings: SortParameter[] = new Array<SortParameter>()

Sortings that were selected by the user and must be applied on next request of data.

note

This property is ready to use with FiltersService since it has filter annotation.

Accessors

defaultSortings

Methods

Protected cloneDefaultSortings

destroy

  • destroy(): void

removeAllSortings

  • removeAllSortings(): void

removeSort

  • removeSort(fieldName: string): void
  • Removes sort with specified field name from sortings array.

    Parameters

    • fieldName: string

      name of the sort to remove.

    Returns void

setSort

  • setSort(fieldName: string, savePrevious: boolean): void
  • Sets sortings according to specified parameters.

    Parameters

    • fieldName: string

      name of the field by which sorting must be executed on server. This value will be used as SortParameter.fieldName.

      In case when sorting with the same field name is already specified, direction of this sorting will be toggled to reversed value and this sorting will be pushed to the end of sortings array. So it will be applied last.

    • savePrevious: boolean

      true to keep previously applied sortings in sortings array.

    Returns void

Generated using TypeDoc