Replies: 1 comment
-
Hard to give you a solid answer for this without understanding your full code, but this just extends Filament's Repeater field so setting the content would be done in the same way as it would with the Repeater field. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to fill the repeater fields with an array of values?
I have a button that will generate an array where I need it to fill the repeater fields based on that array.
[['student_id' => 123, 'grade'=>321, 'effort'=> 1, 'average' => '2'], ['student_id' => 125, 'grade'=>322, 'effort'=> 3, 'average' => '5']]
return $form
->schema([
Forms\Components\Repeater::make('grades'),
TableRepeater::make('users')
->columns()
->addable(false)
->headers([
Header::make('name')->width('auto'),
Header::make('brand')->width('200px'),
Header::make('quantity')->width('200px'),
Header::make('price')->width('200px'),
])
->schema([
Forms\Components\View::make('asd2')->viewData(['name' => '123'])
->view('filament.label'),
Forms\Components\TextInput::make('grade'),
Forms\Components\TextInput::make('effort'),
Forms\Components\TextInput::make('average'),
])
->deletable(false)
->reorderable(false)
->defaultItems(10)
->columnSpan('full')
]);
Beta Was this translation helpful? Give feedback.
All reactions