rappasoft / laravel-livewire-tables

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

[Bug]: Bulk Actions - Deselect all #1301

Closed OndrejMiko closed 1 year ago

OndrejMiko commented 1 year ago

What happened?

When I click on checkbox in TH to select all it works , but when i clicked on "Deselect All" button it deselect all items but TH main checkbox stay checked

Screenshot 2023-08-14 at 17 04 36 Screenshot 2023-08-14 at 17 04 45

How to reproduce the bug

It do allways when i try

Package Version

2.5

PHP Version

8.2.x

Laravel Version

10.0.3

Alpine Version

3.4.2

Theme

Tailwind 3.x

Notes

No response

Error Message

No response

lrljoe commented 1 year ago

I notice you're on version 2.5 of the package. Are you able to update to the latest version?

There were some issues prior to 2.15 with bulk actions.

OndrejMiko commented 1 year ago

Sorry my bad I mispelled version , I am on version 2.15 , I send bad request . Its problem on version 2.15 . And found new one. If I have no items in table , main checkbox to select is selected

lrljoe commented 1 year ago

Thanks for the update @OndrejMiko - I've got this on my to-do list to address both issues.

lrljoe commented 1 year ago

Are you using simple pagination out of interest?

OndrejMiko commented 1 year ago

Are you using simple pagination out of interest?

What u mean simple pagination , pagination in livewire table ?

lrljoe commented 1 year ago

Yes, I'm in the process of reviewing the bug, but if you could share the contents of your configure() method from the component then that'd be great

LaMance22 commented 1 year ago

I have the same problem. In addition, if I select all the results and export to EXCEL, the checkbox for selecting all is not unchecked.

I check "demo" https://tables.laravel-boilerplate.com/tailwind - it works, but the demo doesn't use AlpineJS.

    public function bulkActions(): array
    {
        return [
            'exportToXlsx' => __('Export to Excel),
        ];
    }
    public function exportToXlsx()
    {
        if ($this->getSelected()) {
            $clients= $this->getSelected();
            $this->clearSelected();
            return Excel::download(
                new TableExport($clients),
                __('Clients').'_'.date('d-m-Y_H-m-s').'.xlsx'
            );
        }
    }
lrljoe commented 1 year ago

Fix for this will be out next week!

LaMance22 commented 1 year ago

Fix for this will be out next week!

Hi, did you manage to solve the problem? If so, can you describe what changes should be made to the files? I'm pressed for time so I'll do it manually and then update it when it's available. Best regards.

lrljoe commented 1 year ago

If I didn't merge this fix already, then I'll take a look this weekend and figure out why I didn't, and get it merged in, or at least explain the fix. Apologies, I've been kept busy with v3 lately.

lrljoe commented 1 year ago

V3 Beta is out. So I will be reviewing backports this weekend, and reviewing any v2 bugs

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.