TableRepeater / Repeater populating form
Trying to use the TableRepeater plugin and it's working great except I have rows in my database that I want to populate the form with, and I can't seem to get it to do that. I must be missing something. This is an edit modal action on a table row, if that's matters. So the user clicks the table row's edit button, which brings up a modal that should display all the line items of the parent row in the TableRepeater.
Solution:Jump to solution
ok, that's helpful. It didn't work with fillFormUsing, but there's a fillForm method and that worked!
```php
->fillForm(function (AutomatedSalesJournalEntryHeader $record) {
return [
'lines' => $record->lines->map(function (AutomatedSalesJournalEntryLine $line) {...
6 Replies
Is the relationship lines a hasMany relationship?
it is
I have a feeling you likely need to fillFormUsing() with finding the record then
You might expect model to do that, but it won't know where to find the data.
Solution
ok, that's helpful. It didn't work with fillFormUsing, but there's a fillForm method and that worked!
Thanks!
Ahh that's the ticket. Well done!