Harold
Harold
FFilament
Created by Harold on 11/14/2024 in #❓┊help
How to disable the previous button on Wizard Form
The question is self explanatory. Found one question which was the same but it does not work. It's visually disabled but you can still click on it and go back. ->previousAction(fn ($action) => $action->disabled())
1 replies
FFilament
Created by Harold on 11/1/2024 in #❓┊help
Wizard Form disable next/previous
Is there a way to programatically stop going to the next or previous step based on some conditions? i know you can use things like:
->disabled()
->disabled()
But that only applies to the visual change. Youre still able to proceed.
7 replies
FFilament
Created by Harold on 9/18/2024 in #❓┊help
Get selected rows in Wizrd form
Hello guys. Im buinding a wizard form and first step I wanna have a table and make it selectable so in step I can use all selected records as form input. How can I do this? What I have is:
public function table(Table $table): Table
{
return $table
->query(Broker::query())
->columns([
TextColumn::make('name')->label('Broker Name'),
])
->selectable()
// ->actions([
// Action::make('select')
// ->accessSelectedRecords()
// ->action(function (Broker $record, Collection $selectedRecords) {
// dump($selectedRecords);
// $this->brokers = $selectedRecords->pluck('id')->toArray();
// })->hidden(),
// ])
->filters([
])
->reorderable(false);
}
public function table(Table $table): Table
{
return $table
->query(Broker::query())
->columns([
TextColumn::make('name')->label('Broker Name'),
])
->selectable()
// ->actions([
// Action::make('select')
// ->accessSelectedRecords()
// ->action(function (Broker $record, Collection $selectedRecords) {
// dump($selectedRecords);
// $this->brokers = $selectedRecords->pluck('id')->toArray();
// })->hidden(),
// ])
->filters([
])
->reorderable(false);
}
Wizrd builder (important step):
Wizard\Step::make('Brokers')
->schema([
Forms\Components\Placeholder::make('brokers_table')
->label('Broker Selection')
->content(fn () => $this->table->render()), // Rendering the table within the form
])->afterValidation(function () {
dump('VALIDATION');
dump($this->table->getLivewire()->getSelectedTableRecords());
dump($this->brokers);
}),
Wizard\Step::make('Brokers')
->schema([
Forms\Components\Placeholder::make('brokers_table')
->label('Broker Selection')
->content(fn () => $this->table->render()), // Rendering the table within the form
])->afterValidation(function () {
dump('VALIDATION');
dump($this->table->getLivewire()->getSelectedTableRecords());
dump($this->brokers);
}),
2 replies