Options
All
  • Public
  • Public/Protected
  • All
Menu

Class List

Hierarchy

  • List

Index

Constructors

constructor

Properties

Protected asyncSubscriber

asyncSubscriber: AsyncSubscriber

Protected destroyedInternal

destroyedInternal: boolean = false

fetchMethod

fetchMethod: function

Method for getting data. This parameter is required and its configuration is necessary.

This method get one parameter with the settings of the request implementing ListRequest contract for the simple lists and PagedListRequest one for the paged lists. The return value of this method should be any subscribable object which can be handled by AsyncSubscriber. For the simple lists the response should contain array with the records. As for the paged ones, it should implement ListResponse contract.

Type declaration

    • (requestParams: any): any
    • Parameters

      • requestParams: any

      Returns any

Protected filtersService

filtersService: FiltersService

Protected initedInternal

initedInternal: boolean = false

items

items: any[] = new Array<any>()

Array of elements transferred in the ListResponse.items property.

keepRecordsOnLoad

keepRecordsOnLoad: boolean = List.settings.keepRecordsOnLoad

Specifies that list must destroy previously loaded records immediately or keep them until data request is completed.

Protected pagerInternal

pagerInternal: Pager

Protected sortingsService

sortingsService: SortingsService

stateServices

stateServices: StateService[] = new Array<StateService>()

Array of registered StateService instances.

Protected statusInternal

statusInternal: OperationStatus = OperationStatus.Initial

Accessors

busy

  • get busy(): boolean
  • returns true, if there is a data request executed at the moment (i.e. {@link state} is equal to {@link ProgressState.Progress})

    Returns boolean

destroyed

  • get destroyed(): boolean
  • True if the service was already destroyed via destroy call.

    Returns boolean

inited

  • get inited(): boolean
  • True if the service was already initialized via init call.

    Returns boolean

pager

  • get pager(): Pager
  • set pager(value: Pager): void

ready

  • get ready(): boolean
  • returns true, if there is no data request executed at the moment (i.e. {@link state} is NOT equal to {@link ProgressState.Progress})

    Returns boolean

status

Methods

Private beginRequest

  • beginRequest(): any

cancelRequests

  • cancelRequests(): void
  • Cancels the request executed at the moment.

    Returns void

clearData

  • clearData(): void
  • Clears items array. Calls destroyAll method for items array to perform optional destroy logic of the elements. {@see destroyAll}

    Returns void

destroy

  • destroy(): void
  • Performs destroy logic of the list itself and all of the inner services.

    Returns void

getRequestState

  • getRequestState(filterFn?: function): any

init

  • init(): void
  • Performs initialization logic of the service. This method must be called before first use of the service.

    Returns void

loadData

  • loadData(): any

Private loadDataFailCallback

  • loadDataFailCallback(): void

Private loadDataSuccessCallback

loadFailCallback

  • loadFailCallback(): void
  • Callback which is executed if fetchMethod execution finished with error.

    Returns void

loadSuccessCallback

registerFilterTarget

  • registerFilterTarget(...targets: any[]): void

registerStateService

  • Registers passed object(s) as state service to manage the list state.

    Parameters

    Returns void

reloadData

  • reloadData(): any

Private reloadDataFailCallback

  • reloadDataFailCallback(): void

Private reloadDataSuccessCallback

removeFilterTarget

  • removeFilterTarget(...targets: any[]): void

removeStateService

  • Removes passed object(s) from state services collection of the list.

    Parameters

    Returns void

resetSettings

  • resetSettings(): void
  • Resets the list parameters (sortings, paging, filters) to their default values.

    Returns void

Private responseHasStatus

  • responseHasStatus(response: ListResponse<any> | any[]): boolean

Private tryCleanItemsOnLoad

  • tryCleanItemsOnLoad(requestCompleted: boolean): void
  • Parameters

    • requestCompleted: boolean

    Returns void

Private tryCleanItemsOnReload

  • tryCleanItemsOnReload(requestCompleted: boolean): void
  • Parameters

    • requestCompleted: boolean

    Returns void

Private tryInterceptStatusResponse

  • tryInterceptStatusResponse(response: any): boolean
  • Parameters

    • response: any

    Returns boolean

Object literals

Static settings

settings: object

Global settings of list..

These settings are static and their values are copied to the properties of the same name for each instance of List type.

So, changing of this settings will affect all instances of List type that will be created after such changes. If you want to change settings of concrete object you can use it the same name properties.

keepRecordsOnLoad

keepRecordsOnLoad: boolean = false

Generated using TypeDoc