Update Parent Form data after Relationship Manager update

Hi all I have an Edit page with a relationship manager table. I update an item on the table and I now want to update the parent form to reflect a new 'total' field. I have this so far:
$this->dispatch('DocketEdit.refreshAfterDocketPriceChange');
$this->dispatch('DocketEdit.refreshAfterDocketPriceChange');
#[On('DocketEdit.refreshAfterDocketPriceChange')]
public function refreshForm(): void
{
$this->refreshFormData(['total_estimate','total_cost']);
$this->save();
}
#[On('DocketEdit.refreshAfterDocketPriceChange')]
public function refreshForm(): void
{
$this->refreshFormData(['total_estimate','total_cost']);
$this->save();
}
It works but I get two Save notifcations.
$this->refreshFormData(['total_estimate','total_cost']);
$this->refreshFormData(['total_estimate','total_cost']);
works great but as I have the unsaved notifactions on if I try to navigate away it thinks there is unsaved data. So I added in the $this->save() Is this really the best way to update refresh the parent form? as currently Im updating the form twice. Once in an After() action on the table and again after the form has refreshed.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server