F
Filamentβ€’2w ago
trymedo

Table Widget - extremePaginationLinks and queryStringIdentifier not working

As per screenshots - I've tried setting the queryStringIdentifier and extremePaginationLinks on a table widget but it doesn't seem to work. I'm still getting ?page=2 in the URL and no extra pagination links 😒 Is this a bug or am I maybe expecting too much of the widgets? If anyone has any tips on how I could get this working I'd be very grateful.
<?php

namespace App\Filament\Widgets;

use App\Enums\DashboardGroup;
use App\Models\WidgetCacheRevenue;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Filament\Widgets\TableWidget as BaseWidget;

class DailyRevenue extends BaseWidget
{
protected int | string | array $columnSpan = 'full';

public function table(Table $table): Table
{
return $table
->query(WidgetCacheRevenue::query())
->columns([
TextColumn::make('created_at')
->date('jS M Y')
->label('Date'),
TextColumn::make('impressions')
->numeric(),
TextColumn::make('revenue_raw')
->numeric(decimalPlaces: 2)
->label('Earnings'),
TextColumn::make('viewability')
->label('Viewability')
->numeric(decimalPlaces: 2)
->suffix('%'),
])

// These two functions don't appear to do anything on a widget?
->queryStringIdentifier('daily-revenue')
->extremePaginationLinks();
}
}
<?php

namespace App\Filament\Widgets;

use App\Enums\DashboardGroup;
use App\Models\WidgetCacheRevenue;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Filament\Widgets\TableWidget as BaseWidget;

class DailyRevenue extends BaseWidget
{
protected int | string | array $columnSpan = 'full';

public function table(Table $table): Table
{
return $table
->query(WidgetCacheRevenue::query())
->columns([
TextColumn::make('created_at')
->date('jS M Y')
->label('Date'),
TextColumn::make('impressions')
->numeric(),
TextColumn::make('revenue_raw')
->numeric(decimalPlaces: 2)
->label('Earnings'),
TextColumn::make('viewability')
->label('Viewability')
->numeric(decimalPlaces: 2)
->suffix('%'),
])

// These two functions don't appear to do anything on a widget?
->queryStringIdentifier('daily-revenue')
->extremePaginationLinks();
}
}
No description
No description
1 Reply
trymedo
trymedoβ€’2w ago
Updated post as I didn't realise screenshots of code were not allowed, apologies. I've tested the queryStringIdentifier on another page and it works fine. It feels both of these issues (query string and normal pagination) is only an issue for Widgets. I can work around this for now but does anyone know if there's a plan to get custom pagination queries on widgets in future? I would happily work on a PR for it myself but I'm still fairly new to Filament and don't really know where to begin.