Quentin
Quentin
FFilament
Created by Quentin on 8/19/2024 in #❓┊help
Table on desktop, Split on mobile
Hi, I would like to display my records as a table on desktop and in a Split on mobile. I could do it using two components but what about performances ? Is there an easier way to achieve this ? Ty in advance for your answers and sorry for the bad english.
4 replies
FFilament
Created by Quentin on 8/7/2024 in #❓┊help
Not able to filter table on custom livewire component
What I am trying to do: I try to filter a table implemented in a custom livewire component. What I did: I added the HasTable and HasForm contracts and the useInteractsWithTable and the useInteractsWithForm traits in my custom livewire component. I also implemented the table function, my records are well retrieved and displayed then i added a SelectFilter to filter on a category field. My issue/the error: When i use my filter nothing happens and i have no errors, the filter does not appears in the table header, the query strings are not updated and ofcourse my table is not filtered. The same table is working great in admin panel.
$table
->relationship(fn (): HasMany => getAsUser()->profile->products())
->recordTitleAttribute('wording')
->emptyStateDescription('Ajouter un produit pour commencer')
->headerActions([
])
->columns([
TextColumn::make('wording')
->label('Libellé')
->weight(FontWeight::Bold)
->sortable(),
TextColumn::make('category')
->label('Catégorie')
->badge()
->sortable()
->toggleable(),
TextColumn::make('created_at')
->label('Date d\'ajout')
->date('d/m/Y', \getAsUser()->timezone)
->sortable(),
])
->filters([
SelectFilter::make('category')
->label('Catégorie')
->options(ProductCategory::class)
->native(false)
])
->actions([
])
->bulkActions([
]);
$table
->relationship(fn (): HasMany => getAsUser()->profile->products())
->recordTitleAttribute('wording')
->emptyStateDescription('Ajouter un produit pour commencer')
->headerActions([
])
->columns([
TextColumn::make('wording')
->label('Libellé')
->weight(FontWeight::Bold)
->sortable(),
TextColumn::make('category')
->label('Catégorie')
->badge()
->sortable()
->toggleable(),
TextColumn::make('created_at')
->label('Date d\'ajout')
->date('d/m/Y', \getAsUser()->timezone)
->sortable(),
])
->filters([
SelectFilter::make('category')
->label('Catégorie')
->options(ProductCategory::class)
->native(false)
])
->actions([
])
->bulkActions([
]);
Thank you in advance for your answers and sorry for the bad english.
4 replies