rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.77k stars 331 forks source link

Wrong item count with bootstrap 4 template #319

Closed Restingo closed 3 years ago

Restingo commented 3 years ago

When using pagination sometimes when changing pages the "showing x to y" reports the wrong numbers. For example

image

image

but there are only 27 entries in the database.

rappasoft commented 3 years ago

Those numbers come right from the Laravel paginator, you're going to need to provide more details because you're the first with this issue so it's likely something in your application.

Restingo commented 3 years ago

I'm using latest version of laravel-livewire-tables, laravel/framework v8.37.0, bootstrap 4 theme and table with three columns and default settings. Server is artisan on local development machine. What else do you need?

rappasoft commented 3 years ago

You didn't publish and modify this template? If there was something wrong there would be more words stuck in your numbers since there is "Showing" "to" "of" "results", with no conditionals so they show all the time.

mrl22 commented 3 years ago

@Restingo is correct, I have tested this and have the same issue. It seems to be when navigating to the last page and back to page 1. No custom templates, standard model with no modifications.

See here: Screencast

My query:

public function query(): Builder { return User::query(); }

Restingo commented 3 years ago

@rappasoft nope, as @mrl22 said, default templates.

rappasoft commented 3 years ago

Interesting I see, I was able to reproduce. I'll have to dig into it.

SPQRBrutus commented 3 years ago

I don't know why but its deleting whole row from code in pagination.blade.php Between <strong>{{ $rows->count() ? $rows->lastItem() : 0 }}</strong> and <strong>{{ $rows->total() }}</strong> When you use <span>@lang('of')</span> insted of @lang('of') it's start working.

rappasoft commented 3 years ago

Fixed