Pagination not showing in dashboard table widget
Hello All,
On my dashboard I have given a table widget for expiry alert and it is not showing pagination as the default tables. It shows like this...
Thank you.
4 Replies
I think by default table widgets use simple pagination. You should be able to configure that.
thanks for your reply @Dennis Koch I think default pagination is this only. But I want it toshow the total results plus the page number. After exploring a bit I got this "use Tables\Concerns\InteractsWithTable;" but when I use this I cannot see the table heading as 'Expiry Alert'.
Removing this from TableWidget solves the problem
protected function paginateTableQuery(Builder $query): Paginator
{
return $query->simplePaginate($this->getTableRecordsPerPage() == 'all' ? $query->count() : $this->getTableRecordsPerPage());
}
You can add this in the Widget class
UPDATE: