change records per page in admin panel v2
protected function getTableRecordsPerPageSelectOptions(): array
{
return [10, 25, 50, 100];
} , this fn can be used in livewire component, how to do this in admin panel in v2?
4 Replies
In the admin panel it needs to be on the page where the table is not the resource itself. Check you getPages method and you'll see the name of the class mapped to the 'index' route. In the below example you'll want to add that method to the ListRoles class:
You'll edit it to look something along the lines of this:
Resulting in:
I have only Resource (noList, Create, Edit), so I put the fn in Manage and works. Ty
No worries, yeah the ManageRecords page inherits the ListRecords page so same logic. Likewise, if you wanted to make use of a method that applies to a form; you would use that on either the manage class or the Edit/Create classes