F
Filament3mo ago
Mikey

Show Result and Number of Pagination Not Show

Anyone can help? my table List not show Result and Number Pagination , i use new filament version.
No description
13 Replies
LeandroFerreira
LeandroFerreira3mo ago
Are you using the Panel builder? Is it a Resource, Custom page..?
Goros
Goros5w ago
@LeandroFerreira I'm also having the same issue I'm using resource not a custom page
LeandroFerreira
this should show by default https://demo.filamentphp.com/shop/orders please provide more info
Goros
Goros5w ago
here is the code:
public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(function (Builder $query) {
$query->selectRaw("
*,
CONCAT_WS(' & ',
CASE WHEN sellable THEN 'Sellable' END,
CASE WHEN purchaseable THEN 'Purchasable' END
) AS attributes
");

$query->where('company_id', auth()->user()->current_company_id);
})
->columns([
TextColumn::make('name')
->label('Name')
->searchable(),
TextColumn::make('company.name')
->label('Company Name'),
TextColumn::make('attributes')
->label('Attributes')
->badge(),
TextColumn::make('price')
->money('USD')
->sortable(),
TextColumn::make('stock_quantity')
->label('Stock Quantity')
->sortable(),
TextColumn::make('sku')
->label('SKU'),
TextColumn::make('is_in_stock')
->label('In Stock')
->state(fn ($record) => $record->is_in_stock > 0 ? 'In Stock' : 'Out of Stock'),
// Add expiry_date column
TextColumn::make('expiry_date')
->label('Expiry Date')
->sortable()
->dateTime()
->date(),
])
->deferLoading() // Tables with lot of data may take time to load, which case we use this to load the table data asynchronously
->striped()
->filters([/* your filters here */])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([/* your bulk actions here */]);
}
public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(function (Builder $query) {
$query->selectRaw("
*,
CONCAT_WS(' & ',
CASE WHEN sellable THEN 'Sellable' END,
CASE WHEN purchaseable THEN 'Purchasable' END
) AS attributes
");

$query->where('company_id', auth()->user()->current_company_id);
})
->columns([
TextColumn::make('name')
->label('Name')
->searchable(),
TextColumn::make('company.name')
->label('Company Name'),
TextColumn::make('attributes')
->label('Attributes')
->badge(),
TextColumn::make('price')
->money('USD')
->sortable(),
TextColumn::make('stock_quantity')
->label('Stock Quantity')
->sortable(),
TextColumn::make('sku')
->label('SKU'),
TextColumn::make('is_in_stock')
->label('In Stock')
->state(fn ($record) => $record->is_in_stock > 0 ? 'In Stock' : 'Out of Stock'),
// Add expiry_date column
TextColumn::make('expiry_date')
->label('Expiry Date')
->sortable()
->dateTime()
->date(),
])
->deferLoading() // Tables with lot of data may take time to load, which case we use this to load the table data asynchronously
->striped()
->filters([/* your filters here */])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([/* your bulk actions here */]);
}
LeandroFerreira
share a screenshot..
Goros
Goros5w ago
Oh sorry
Goros
Goros5w ago
No description
Goros
Goros5w ago
i want numbered pagination but its conflicting with something
LeandroFerreira
it is showing the simple pagination because you are using a cluster add to the resource
protected static SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;
protected static SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;
Goros
Goros5w ago
Okay thank you it is fix now 🙏
LeandroFerreira
Simple pagination is automatically applied based on Tailwind breakpoints and the available area where the table is rendered @Mikey 👆
Mikey
MikeyOP3w ago
ah thanks , now show
Finn
Finn2w ago
hey guys, just jumping on this because I have a similar question - I can't get the "Showing x of x results" to appear in the bottom left of my table with the page stepper in the bottom right. I think, like Leandro has said that simple pagination is being applied by default. I'm only got forms, tables and infolists installed in my project, not the panel builder - does this mean that this functionality isn't available to me? I'm trying to apply it to a livewire component that implements HasForms and HasTable. Many thanks! EDIT: I've realised what the problem is: it's a breakpoint issue. my table is only 768px wide at maximum so it never grows to a point where the pagination options that I'm referring to are available. I'm now wondering if there's a way to customise the breakpoint for switching between these two layouts?

Did you find this page helpful?