Very odd behaviour with calling a function but modal opens instead.

Very odd behaviour is happening. I have a form over top of a table. In the form I have a datetime picker to set a date to go fetch data from an API. I have a filter button which applies the data. It loads the data refreshes the table with the data. I also have a table with bulk actions. When I run a bulk action save. The table goes blank and nothing works. If I press the Filter button to set the datatime in the form. It pops up the modal from the bulk save. Always, until I refresh the page. It also never calls my save function, only pops open an modal.
return $form->
schema([
Grid::make()->schema([
DateTimePicker::make('start_date')
//->live()
->label('Filter Start Date')
->native(false)
->closeOnDateSelection(),
Actions::make([
Action::make('setStartDate')
->label('Set Filter')
->action(function () {
$this->applyFilter();
})
])->verticalAlignment(VerticalAlignment::End),

]),
]);
return $form->
schema([
Grid::make()->schema([
DateTimePicker::make('start_date')
//->live()
->label('Filter Start Date')
->native(false)
->closeOnDateSelection(),
Actions::make([
Action::make('setStartDate')
->label('Set Filter')
->action(function () {
$this->applyFilter();
})
])->verticalAlignment(VerticalAlignment::End),

]),
]);
Table
return $table
->query($this->query)
->columns([
TextColumn::make('customerName'),
TextColumn::make('customerEmail'),
TextColumn::make('id')
])
->bulkActions([
BulkAction::make('Save')
->button()
->action(fn(Collection $records) => $this->saveOrder($records)),
]);
return $table
->query($this->query)
->columns([
TextColumn::make('customerName'),
TextColumn::make('customerEmail'),
TextColumn::make('id')
])
->bulkActions([
BulkAction::make('Save')
->button()
->action(fn(Collection $records) => $this->saveOrder($records)),
]);
Two functions
public function saveOrder($records)
{

dd($records); // this never gets run

}
public function saveOrder($records)
{

dd($records); // this never gets run

}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server