Table ExportAction trigger error on List page #64

Closed
opened 2023-03-30 03:39:39 +00:00 by raditzfarhan · 3 comments
raditzfarhan commented 2023-03-30 03:39:39 +00:00 (Migrated from github.com)

Hi, I'm trying to add the Export action next to the Create button on List page but unable to do so. Here is the snippet:-

use App\Exports\InspectionExport;
use pxlrbt\FilamentExcel\Actions\Tables\ExportAction;

class ListInspections extends ListRecords
{
    protected static string $resource = InspectionResource::class;

    protected function getActions(): array
    {       
        return [
            Actions\CreateAction::make(),
            ExportAction::make()->exports([
                 InspectionExport::make(),
            ]),
        ];
    }

It will prompt this error as below:-

image

I'm not sure if I use it correctly though. Let me know if it's not the way how it works. What I'm trying to achieve is something like below:-

image

Thanks for your time.

Hi, I'm trying to add the Export action next to the Create button on List page but unable to do so. Here is the snippet:- ``` use App\Exports\InspectionExport; use pxlrbt\FilamentExcel\Actions\Tables\ExportAction; class ListInspections extends ListRecords { protected static string $resource = InspectionResource::class; protected function getActions(): array { return [ Actions\CreateAction::make(), ExportAction::make()->exports([ InspectionExport::make(), ]), ]; } ``` It will prompt this error as below:- ![image](https://user-images.githubusercontent.com/1203676/228722127-5652918d-927d-43f7-96b0-c47a27930ef8.png) I'm not sure if I use it correctly though. Let me know if it's not the way how it works. What I'm trying to achieve is something like below:- ![image](https://user-images.githubusercontent.com/1203676/228722487-9580259d-a957-45d9-9d71-f6feffd0d573.png) Thanks for your time.
pxlrbt commented 2023-04-04 06:21:36 +00:00 (Migrated from github.com)

I think the issue is, that you are trying to use a Table Action on a Page. You can use the Page Action and it should work.

I think the issue is, that you are trying to use a Table Action on a Page. You can use the Page Action and it should work.
raditzfarhan commented 2023-04-05 03:36:37 +00:00 (Migrated from github.com)

Thanks for your reply. If I use Page Action, yes the button will appear. But I encounter a new error as shown below. Not sure what I'm missing.

image

Thanks for your reply. If I use Page Action, yes the button will appear. But I encounter a new error as shown below. Not sure what I'm missing. ![image](https://user-images.githubusercontent.com/1203676/229974822-d043b625-07d6-4782-960d-f837f76a1cf6.png)
pxlrbt commented 2023-04-05 07:09:20 +00:00 (Migrated from github.com)

Mh, I think you can't define them on the ListPage currently, then. Can you try via Resource and the ->headerActions() and remove getActions()?

Mh, I think you can't define them on the ListPage currently, then. Can you try via Resource and the `->headerActions()` and remove `getActions()`?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pxlrbt/filament-excel#64
No description provided.