Closed annejan89 closed 2 years ago
@annejan89, does the button disappear while reordering only, or permanently?
Also, could you share the exact code you use to configure the reordering on the relation manager? Usually, you'd just chain reorderable('sort')
on the table inside the table()
method on the relation manager class.
If you could set up a repository which reproduces the problem, we're able to fix the issue much faster.
@annejan89, does the button disappear while reordering only, or permanently?
Permanently
When reordering is turned off / default:
While reordering:
After deleting the getTableReorderColumn() method:
@annejan89 how exactly are you configuring the reordering functionality? 👇
Also, could you share the exact code you use to configure the reordering on the relation manager? Usually, you'd just chain reorderable('sort') on the table inside the table() method on the relation manager class.
If you could set up a repository which reproduces the problem, we're able to fix the issue much faster.
Tried both ways, both cause the problem as described:
class ShiftsRelationManager extends RelationManager {
....
protected function getTableReorderColumn(): ?string
{
return 'sort';
}
Using reorderable() within the table method:
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('name')->label('Naam'),
BadgeColumn::make('status_badge')->label('Capaciteit')
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
])
->reorderable('sort');
}
Thanks for the more detailed snippets, @annejan89.
I can't reproduce the problem. Header actions show just fine for me when configuring a table as reorderable. Could you set up a clean Laravel project with minimal code required to show the problem? If you share the repository URL here, we can have a look.
The same thing happens to me. As soon as I add protected function getTableReorderColumn() to the Relation Manager, the headerAction disappears
Adding
protected function getTableReorderColumn(): ?string
{
return 'sort';
}
results in
.
I still can't reproduce the issue. As I asked before, could someone set up a reproduction repository?
Are you all on the latest version? I think I fixed this 2 days ago in v2.15.3, the issue report is v2.15.2
thxxx, @danharrin! it's fixed in v2.15.3
Package
filament/filament
Package Version
v2.15.2
Laravel Version
v9.22.0
Livewire Version
v2.10.6
PHP Version
v8.1.3
Problem description
Using method below to sort table rows by given column.
When using this inside a relationManager the CreateAction button in the header disappears.
Expected behavior
Without using the getTableReorderColumn() method the create button shows correctly.
Steps to reproduce
Tried to overwrite the canCreate method inside the Relationmanager, but without any luck. Guess that getTableReorderColumn doesn't respect and merge with existing headerActions.
Reproduction repository
No response
Relevant log output
No response