Trigger RelationManager `EditAction` from Infolist Section `headerActions`

Hi, I would like to trigger the EditAction of a row in a RelationManager from an Inflost Section headerAction Pressing 1 in the image, should trigger the action of the button at 2. Is this possible?
No description
5 Replies
Proculair
Proculair6mo ago
Hi, if somebody would have the chance to take a look at this that would be awesome
DrByte
DrByte6mo ago
Is there only ever "one" row in the relationManager?
Proculair
Proculair6mo ago
No there are multiple But there is one that is the main row, so to speak
DrByte
DrByte6mo ago
I guess the approach I'd likely explore would be to find a way to determine which record is the "main" one, and then configure the Header Action button to "get" that record, and perform whatever with it. I think the $livewire object on the page has knowledge of all the relation managers, so should be able to find that record row and use it. So, I'd probably end up looking into what the EditAction button on the table row is doing, and create a Header Action button to do mostly the same (I'm guessing you want to make it link to the Edit page (but I guess it could open a modal Edit as well, although that's a little more complex). The challenge isn't so much in the actual actions you want it to do, but in making the header action button able to identify the "main row" record in order to act on it. And you haven't explained the logic of determining what is the "main row", so you'll have to incorporate that logic into whatever logic you use to explore the $livewire object's relation manager elements, etc.
Proculair
Proculair6mo ago
Thank you for you advice. I have already made it quite easy to find the main one. person is the main one. I will try to find out what the edit button on the row does and try to emmulate that
No description