Skip to content

Commit c03a3a7

Browse files
committed
feat: refine listPageSizeOptions type for improved type safety and clarity
1 parent a610e96 commit c03a3a7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ export default {
320320
```
321321

322322
### List Page Size Options
323-
You can define available pagination sizes using options.listPageSizeOptions. This allows users to choose how many records they want to see per page in the list view.
323+
You can define available pagination sizes using options.listPageSizeOptions. This allows users to choose how many records they want to see per page in the list view.
324324
```typescript title="./resources/apartments.ts"
325325
export default {
326326
resourceId: 'aparts',
@@ -360,7 +360,7 @@ Page size switching is implemented via a select dropdown (select input) in the t
360360
- Chooses a value (e.g. 20)
361361
- Table reloads with the new page size
362362
> ☝️Notes
363-
If listPageSizeOptions is not provided, a default set of page sizes will be used. The selected value updates the table immediately and triggers a data refetch. This option works together with listPageSize, which defines both the default value and the available options at the same time.
363+
If `listPageSizeOptions` is not provided (or resolves to an empty array), the page size select is not shown. The selected value updates the table immediately and triggers a data refetch. Use `listPageSize` to define the initial number of records per page, and `listPageSizeOptions` to define which page sizes the user can switch between.
364364

365365
### Virtual scroll
366366

adminforth/types/Common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ export interface AdminForthResourceInputCommon {
472472
* Page size for list view
473473
*/
474474
listPageSize?: number,
475-
listPageSizeOptions?: number[] | ((args: { adminUser: any, adminforth: any }) => number[] | Promise<number[]>);
475+
listPageSizeOptions?: number[] | ((args: { adminUser: AdminUser, adminforth: IAdminForth }) => number[] | Promise<number[]>);
476476

477477
/**
478478
* Whether to use virtual scroll in list view.

0 commit comments

Comments
 (0)