Skip to main content

FrontendAPIInterface

Methods

alert()

alert(params): void

Show an alert

The alert will be displayed to the user

Example:

 window.adminforth.alert({message: 'Hello', variant: 'success'})

Parameters

ParameterTypeDescription
paramsAlertParamsThe parameters of the alert

Returns

void


clearListFilters()

clearListFilters(): void

Clear all filters from the list

Returns

void


confirm()

confirm(params): Promise<void>

Show a confirmation dialog

The dialog will be displayed to the user

Example:

const isConfirmed = await window.adminforth.confirm({message: 'Are you sure?', yes: 'Yes', no: 'No'})
if (isConfirmed) {
your code...
}

Parameters

ParameterTypeDescription
paramsConfirmParamsThe parameters of the dialog

Returns

Promise<void>

A promise that resolves when the user confirms the dialog


setListFilter()

setListFilter(filter): void

Add a filter to the list of filters. Works only when user located on the list page. Can be used to set filter from charts or other components in pageInjections.

Example:

window.adminforth.updateListFilter({field: 'name', operator: 'ilike', value: 'john'})

Parameters

ParameterTypeDescription
filteranyThe filter to add

Returns

void


updateListFilter()

updateListFilter(filter): void

Update a filter in the list of filters

Example:

window.adminforth.updateListFilter({field: 'name', operator: 'ilike', value: 'john'})

Parameters

ParameterTypeDescription
filteranyThe filter to update

Returns

void