F
Filamentβ€’7mo ago
Jessy

Wizard goToStep(x)

Is it possible to have a button in a Wizard component, which when pressed will take you to a certain step?
5 Replies
Wannes
Wannesβ€’7mo ago
You can just add ->skippable()
Jessy
JessyOPβ€’7mo ago
I don't want to change the step by clicking it, I want to change it from an action
LeandroFerreira
LeandroFerreiraβ€’7mo ago
do you mean, an extra wizard action? where would you like to add this?
Krzysztof
Krzysztofβ€’7mo ago
<a href="#" class="text-sm font-medium" wire:click.prevent.stop="skip">
Skip
</a>
<a href="#" class="text-sm font-medium" wire:click.prevent.stop="skip">
Skip
</a>
public function skip()
{
$this->dispatch('next-wizard-step', statePath: 'data');
}
public function skip()
{
$this->dispatch('next-wizard-step', statePath: 'data');
}
I've put it as a view in nextAction of wizard, so I needed to use .stop to stop propagation of the action event what I would like to do is to detect which step was skipped, if anyone has idea I'd be grateful sorry @Jessy, but I'm not sure how to go to the certain step, just the next one in the wizard.blade.php when the step is clicked the step value is set to the step id as follows: x-on:click="step = @js($step->getId())". However, I don't know how to access the step value, this would solve my problem too it's an alpine component's field ok, that was simple πŸ˜† :
skip(step)
skip(step)
Then I think you should be able to listen for an event in alpine component, dispatch it from the action/method and set the step variable
Want results from more Discord servers?
Add your server