| [ Web Proxy ] |
| Viewing: https://adminforth.dev/docs/api/FrontendAPI/interfaces/FrontendAPIInterface/ | [Back] [Original] |
list:
object
clearFilters():
void
Clear all filters from the list
void
closeThreeDotsDropdown():
void
Close the three dots dropdown
void
refresh():
Promise<{error?:string; }>
Full refresh the list. Loader will be shown during fetching data. Will fully reload table data from the server. If new data available, it will be shown in the list.
Promise<{ error?: string; }>
setFilter(
filter):void
Set a filter in the list. Works only when user located on the list page. If filter already exists, it will be replaced with the new one. Can be used to set filter from charts or other components in pageInjections.
Filters are automatically marked as hidden (won't count in badge) if:
Example:
import { useAdminforth } from '@/adminforth';
const { list } = useAdminforth();
// Regular filter (will show in badge if column.showIn.filter !== false)
list.setFilter({field: 'name', operator: 'ilike', value: 'john'})
// Hidden filter (won't show in badge if column.showIn.filter === false)
list.setFilter({field: 'internal_status', operator: 'eq', value: 'active'})
Please note that you can set/update filter even for fields which have showIn.filter=false in resource configuration. Also you can set filter for virtual columns. For example Universal search plugin calls updateFilter for virtual column which has showIn.filter=false (because we dont want to show this column in filter dropdown, plugin renders its own filter UI)
| Parameter | Type | Description |
|---|---|---|
filter | FilterParams | The filter to set |
void
silentRefresh():
Promise<{error?:string; }>
Silently Refresh existing rows in the list (without loader). Should be called when table data already loaded, otherwise method will return an error. If new data available, it will not appear in the list.
Promise<{ error?: string; }>
silentRefreshRow(
pk):Promise<{error?:string; }>
Refresh a specific row in the list without loader, row should be already shown in the list, otherwise method will return an error
| Parameter | Type |
|---|---|
pk | any |
Promise<{ error?: string; }>
updateFilter(
filter):void
| Parameter | Type | Description |
|---|---|---|
filter | FilterParams | The filter to update |
void
does the same as setFilter, kept for backward compatibility, will be removed in 4.0.0
Update a filter in the list
Filters visibility in badge is automatically determined by column configuration:
Example:
import { useAdminforth } from '@/adminforth';
const { list } = useAdminforth();
list.updateFilter({field: 'name', operator: 'ilike', value: 'john'})
menu:
object
refresh():
Promise<void>
Refreshes the menu tree and frontend configuration by fetching the latest backend config.
Promise<void>
refreshMenuBadges():
void
Refreshes the badges in the menu, by recalling the badge function for each menu item
void
show:
object
refresh():
void
Full refresh the current record on the show page. Loader may be shown during fetching. Fire-and-forget; you don't need to await it.
void
alert(
params):string|void|Promise<string>
Show an alert
The alert will be displayed to the user
Example:
import { useAdminforth } from '@/adminforth';
const { alert } = useAdminforth();
alert({message: 'Hello', variant: 'success'})
| Parameter | Type | Description |
|---|---|---|
params | AlertParams | The parameters of the alert |
string | void | Promise<string>
clearSaveInterceptors(
resourceId?):void
Clear save interceptors for a specific resource or all resources if no resourceId is provided
| Parameter | Type | Description |
|---|---|---|
resourceId? | string | The resource ID to clear interceptors for |
void
closeUserMenuDropdown():
void
Close the user menu dropdown
void
confirm(
params):Promise<boolean>
Show a confirmation dialog
The dialog will be displayed to the user
Example:
import { useAdminforth } from '@/adminforth';
const { confirm } = useAdminforth();
const isConfirmed = await confirm({message: 'Are you sure?', yes: 'Yes', no: 'No'})
if (isConfirmed) {
your code...
}
| Parameter | Type | Description |
|---|---|---|
params | ConfirmParams | The parameters of the dialog |
Promise<boolean>
A promise that resolves when the user confirms the dialog
registerSaveInterceptor(
handler):void
Register a save interceptor for a specific resource
| Parameter | Type |
|---|---|
handler | (ctx) => Promise<{ error?: string; extra?: any; ok: boolean; }> |
void
runSaveInterceptors(
params):Promise<{error?:string;extra?:any;ok:boolean; }>
Run save interceptors for a specific resource or all resources if no resourceId is provided
| Parameter | Type |
|---|---|
params | { action: "edit" | "create"; resource: any; resourceId: string; values: any; } |
params.action | "edit" | "create" |
params.resource | any |
params.resourceId | string |
params.values | any |
Promise<{ error?: string; extra?: any; ok: boolean; }>
| Web Proxy Viewer | New URL | Original Page |