F
Filament17mo ago
ocram82

Repeater without reordering buttons

Hi i'm using Repeater v3, and i'm following this: https://filamentphp.com/docs/3.x/forms/fields/repeater#reordering-items But the default button for reordering items don't appear on top left of the repeaters....why? Below my code:
Section::make()
->schema([
Repeater::make('sections')
->label('Sections')
->relationship()
->schema([
TextInput::make('name')->required(),
TextInput::make('note'),
Section::make()
->schema([
Repeater::make('products')
->label('Products')
->relationship()
->schema([
TextInput::make('name')->required(),
TextInput::make('description'),
TextInput::make('price')->required(),
])
->columns(3)
->collapsible()
->collapsed()
->cloneable()
->itemLabel(fn (array $state): ?string => $state['name'] ?? null),
])
])
->columns(2)
->collapsible()
->collapsed()
->itemLabel(fn (array $state): ?string => $state['name'] ?? null),
])->compact()
Section::make()
->schema([
Repeater::make('sections')
->label('Sections')
->relationship()
->schema([
TextInput::make('name')->required(),
TextInput::make('note'),
Section::make()
->schema([
Repeater::make('products')
->label('Products')
->relationship()
->schema([
TextInput::make('name')->required(),
TextInput::make('description'),
TextInput::make('price')->required(),
])
->columns(3)
->collapsible()
->collapsed()
->cloneable()
->itemLabel(fn (array $state): ?string => $state['name'] ?? null),
])
])
->columns(2)
->collapsible()
->collapsed()
->itemLabel(fn (array $state): ?string => $state['name'] ?? null),
])->compact()
9 Replies
LeandroFerreira
LeandroFerreira17mo ago
just a test - comment ->relationship() and check if it shows
ocram82
ocram82OP17mo ago
just tryied, but if i comment ->relationship() i can't see the repeater
ocram82
ocram82OP17mo ago
no, mybe this is the issue....what column name should i use? ok solved by adding
->orderColumn('id')
->orderColumn('id')
to the repeater
LeandroFerreira
LeandroFerreira17mo ago
it doesn't matter since you can set on ->orderColumn('sort')
ocram82
ocram82OP17mo ago
thank you very much for your help
LeandroFerreira
LeandroFerreira17mo ago
you should create a new column for that
ocram82
ocram82OP17mo ago
ok for shure
Jean Roumeau
Jean Roumeau14mo ago
I'm having this issue and I already added the sort column. Is this a problem with relations()?
Want results from more Discord servers?
Add your server