Replace modal actions with 'save' and 'save & close'?
this is my first attempt and simply working on have them both , though as i type this, i should probably use the existing submit and relabel it, though i do want to use the above order. My problem with the regular 'save' action that im trying to do above is that its not actually saving it and if i put a `ray() on the action(), it doesnt appear to run. My goal is to have the primary 'save' action to not close the modal and only have it do that if selecting the 'save and close' action
3 Replies
am i overcomplicating this or is there a simpler method to simply having a regular submit and a save, but keep the modal open button?
Have you tried using
halt()
to prevent the modal from closing?I thought that was more for stopping the data from being submitted, but that could work. Ive honest never used it, so i guess i should look into it
@archilex
thanks for the idea of halt()
now i just have to figure out how to rerender the form after i do the halt. This way it shows the updated notes and the note field is empty again (in my saveInquiry() method, i unset the note field after i save it somewhere else)
i swear i saw something about refreshing a modal record from an action, but cant track it down again
@Hugh Messenger now with all your nested modal work, im sure you have had to update the record in a modal. Basically in before the halt, i would need to somehow refill the modals form with $record->refresh() i would think. tried a few things with $livewire and even doing an emit $refresh, but no dice and i dont think that targets the modal anyway