-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Description
There is an issue with filtering when using pagination.
The filter work on first page. but after click page and select filter, datatable doesn't move to first page.
When I look at https://livewire-datatables.com/relation, after set filter on page 2, datatable move to first page.
How to solve this issue?
class DatatableOfUsers extends LivewireDatatable
{
public $exportable = true;
public function builder()
{
return User::query();
}
public function columns()
{
return [
NumberColumn::name('id')
->label('ID')
->defaultSort('asc')
->sortBy('id')
->hide(),
Column::name('name')
->label('Name')
->searchable(),
Column::name('email')
->label('Email')
->searchable(),
Column::name('roles.name')
->filterOn('roles.name')
->filterable( $this->roles->pluck('name') )
->label('role'),
DateColumn::name('created_at')
->label('Created at')
];
}
public function getRolesProperty()
{
return Role::all();
}
}
Metadata
Metadata
Assignees
Labels
No labels
