[Reapeater] Repeater question about one column getting data from the other one
Hi guys,
I have a "users" table, which has id, title and age columns among others.
I'd like to build a repeater made from 2 columns.
The first column would be a general select, made up of user id's and titles.
The second column, I'd like to be a text input and get filled with users age upon the selection of a user in the first column. I'm having trouble coming up on how to do this and, is it even possible?
Any help would be appreciated, thanks!
Solution:Jump to solution
You can use
afterStateUpdated()
and $set
to set the value of another field.
Assuming the select field contains the ID value of the user and the age field is called 'age' on the repeater:
```php...2 Replies
Solution
You can use
afterStateUpdated()
and $set
to set the value of another field.
Assuming the select field contains the ID value of the user and the age field is called 'age' on the repeater:
You can read up more about form injection here https://filamentphp.com/docs/3.x/forms/advanced#form-component-utility-injectionThanks man, this works great!