Okipa / laravel-table

Generate tables from Eloquent models.
MIT License
532 stars 64 forks source link

Duplicated pagination #71

Closed ElCresh closed 3 years ago

ElCresh commented 3 years ago

I've created a new plain project with Laravel 8, Bootstrap 4, Material Design. Footer of tables have a duplicated pagination (Next, Prev buttons). I've tried to edit layout but nothing solved this issue.

image

Okipa commented 3 years ago

Hi @ElCresh, thank you for reporting this.

As I have no issue when using standard Bootstrap 4 integration, I think this could be linked to the Material Design integration and not linked to this package.

I never used the Material Design theme but it may append an additional pagination with javascript. You could investigate in this way to check if there would be a way to disable it.

One other solution would be disabling the package pagination, that you can do with ->rowsNumber(null).

I close this as it seems to be unrelated to this package, please come back to comment this issue if you manage to fix your problem, that could be useful for other users.

ElCresh commented 3 years ago

Thanks for replying. I've managed to narrow down to this section in pagination.blade.php but I can't find a way to edit inside "links()"

<div class="d-flex align-items-center mb-n3 px-3 py-1 pagination-container"> {!! $table->getPaginator()->links() !!} </div>

If I remove this part both pagination disapear. Also ->rowsNumber(null) make pagination disapear.

ElCresh commented 3 years ago

@Okipa I've found the issue. Is causa by Illuminate\Paginate\Paginator that now by deault use Tailwind CSS if not forced by AppServiceProvider

https://laravel.com/docs/8.x/pagination#using-bootstrap

Okipa commented 3 years ago

@ElCresh Nice, good to know, thanks for coming back with the fix !