Repeater on edit page
Hi, guys. I am using a Repeater. On edit, if I don't have any items, the repeater only has the button to create items. Is it possible to display the entire repeater form even if I don't have any items? Instead of create button I need that form to be visible on edit without clicking the button
13 Replies
you can add a new item to the repeater json in the mutateFormDataBeforeFill() probably?
Hm, a good idea. I'll try. Thanks
I got this error "Call to a member function itemLabel() on array" when trying to use mutateRelationshipDataBeforeFill
please send the code
I used mutateRelationshipDataBeforeFill because I got a "doesn't exist mutateRelationshipDataBeforeFill" error
it would be on the page class
not the repeater
but it wont work with relationship(), so dont worry about it
ummmm
let me think
Should I use this on the repeater, right?
yes
What about this?
None of the above options work. I put a dd inside afterStateHydrated and it doesn't seem to do anything. I am using this Repeater in a custom page
Are you calling $this->form->fill() in your mount method?
Yeah
This is my mount method
I've tested and worked, the only concern in my example is only about the empty $state maybe not
! $state
, it can be ! count($state)
or smth else... I don't know why dd in afterStateHydrated did nothing Maybe it's something wrong with this page?