rappasoft / laravel-livewire-tables

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

[Bug]: SelectAll not working if pagination disabled #1865

Open markusnissl opened 4 weeks ago

markusnissl commented 4 weeks ago

What happened?

If you set $this->setPaginationDisabled(); the value of the selectAll checkbox is not updated correctly and always shows an empty result.

How to reproduce the bug

No response

Package Version

3.4.8

PHP Version

8.2.x

Laravel Version

11.20.0

Alpine Version

No response

Theme

Tailwind 3.x

Notes

No response

Error Message

No response

lrljoe commented 3 weeks ago

How big is the table you are using? In terms of number of records.

lrljoe commented 3 weeks ago

@markusnissl - If I don't hear back from you this week, I'll have to close the issue.

markusnissl commented 3 weeks ago

I had 2 records in the table

lrljoe commented 2 weeks ago

Can you share the full table component please

markusnissl commented 2 weeks ago

I think it is better if I show you the exact error what is missing:

In view resources/views/components/table/th/bulk-actions.blade.php you access paginationTotalItemCount without checking if it is null.

By src/Traits/WithPagination.php this value is optional any by default null.

By src/Traits/WithData.php this value is only set to not null in case pagination is enabled.

So what has to be fixed is to check if pagination is enabled in the view and use in case it is not enabled the number of rows.