Class: ApiFunctionDataSource<Data>

index.ApiFunctionDataSource

Uses your custom api function to request data

Type parameters #

Name
Data

Hierarchy #

Constructors #

constructor #

new ApiFunctionDataSource<Data>(apiFunction)

Create a new data source to fetch the paginated table data using your custom api function.

Type parameters #

Name
Data

Parameters #

Name Type Description
apiFunction ApiFunction<Data> the api function which requests data by sending the PaginatedListRequest and returning a PaginatedListResponse

Overrides #

AbstractDataSource.constructor

Defined in #

dataSource/ApiFunctionDataSource.ts:15

Methods #

getQueryObserver #

getQueryObserver(): Readable<QueryObserver<Data>>

Returns #

Readable<QueryObserver<Data>>

Inherited from #

AbstractDataSource.getQueryObserver

Defined in #

dataSource/AbstractDataSource.ts:26


init #

init(config): void

Parameters #

Name Type
config Required<DataTableConfig<Data>>

Returns #

void

Inherited from #

AbstractDataSource.init

Defined in #

dataSource/AbstractDataSource.ts:22


requestData #

requestData(data): void

Called to retrieve the initial datatable entries and everytime the request changes, for example when the user loads the next page, sorts the entries or searches for something

Parameters #

Name Type Description
data PaginatedListRequest<Data> the request data to be passed through to the server

Returns #

void

Overrides #

AbstractDataSource.requestData

Defined in #

dataSource/ApiFunctionDataSource.ts:19