F
Filament9mo ago
ico

Filament v2 Form Builder: How to add button in Repeater ?

How do i add a button in a repeater item ? I have a Repeater with 4 TextInputs that represent some product data. I want to add a button next to them, so when the user clicks on it it will show more information about the fields, or will print out in a PDF format information about the product
Repeater::make('inputs')
->label('')
->schema([
TextInput::make('scannedBarcode')
->disabled()
->columnSpanFull(),

TextInput::make('plannedGoodCode')
->disabled(),

TextInput::make('plannedGoodName')
->disabled(),

TextInput::make('loadedQuantity')
->disabled(),

// add button here

])
->disableItemMovement()
->disableItemCreation()
->columns(3)
Repeater::make('inputs')
->label('')
->schema([
TextInput::make('scannedBarcode')
->disabled()
->columnSpanFull(),

TextInput::make('plannedGoodCode')
->disabled(),

TextInput::make('plannedGoodName')
->disabled(),

TextInput::make('loadedQuantity')
->disabled(),

// add button here

])
->disableItemMovement()
->disableItemCreation()
->columns(3)
3 Replies
ico
icoOP9mo ago
What i just found is that i could do a ViewField in witch i have a button. Witch when clicked will dispatch a event. But how do i catch the index of the repeater so i can send it to the ViewField ?
ico
icoOP9mo ago
But not sure if this is the right path Is there a better way ?
Want results from more Discord servers?
Add your server