#repeater action

11 messages · Page 1 of 1 (latest)

young egret
#

im trying to user and Action::make() inside a repeater but it doesnt do anything for example:

                                                    ->schema([
                                                        Action::make()
                                                            ->action(fn(Get $get) => dd($get))
                                                    ]),```
unborn sapphireBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

analog mango
#

You need to give it a name to start:

Action::make('my_action')

The only one's you don't need to do that is on the default, edit, view, create etc as they are configured to have their own names.

young egret
#

it does have a name

analog mango
#

Not in hte above code?

young egret
#
Action::make('apply')
    ->icon('heroicon-o-check')
    ->color('primary')
    ->size('sm')
    ->action(fn(Set $set, Get $get) => self::applyBulkCosts($set, $get))
analog mango
#

You have a repeater make, and you are including the action within the schema, that's not supported usually.

Are you wanting the action to be for the individual rows?

young egret
#

this is what im working on

analog mango
#

So which part of that is the repeater? The repeater looks to be part of the lower section.

Personally, I would have an afterStateUpdated and then run applyBulkCosts as it should be fairly quick.

young egret
#

those are two repeaters