Replies: 1 comment 2 replies
-
Filters is definitely working in my demo instance for BS5. Looking at your pastebin, your filter isn't actually setup to apply/do anything, and seems to have a list of the same items you're going to see in the main table. However I'll take your list of the same model as your desired outcome, see below public function filters(): array
{
return [
MultiSelectFilter::make('Post')
->options(
Post::query()
->orderBy('title')
->get()
->keyBy('id')
->map(fn($post) => $post->title)
->toArray()
),
];
} Something like the below will actually do what it seems you're trying to do: public function filters(): array
{
return [
MultiSelectFilter::make('Post')
->options(
Post::query()
->orderBy('title')
->get()
->keyBy('id')
->map(fn($post) => $post->title)
->toArray()
)
->filter(function (Builder $builder, array $values) {
$builder->whereIn('id', $values);
}),
];
} If this isn't working, can you check the DevTools console in your browser for any errors, both on loading the page, and on clicking the filters button. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a problem with the toolbar button Filter and Column button when using bootstrap 5, when I click there is no response and the dropdown does not appear. But for Bulk Action it works fine. Is it necessary to modify
toolbar.blade.php
?Livewire table class : https://pastebin.com/1Q0xMrZM
web2-2023-03-16_16.55.10.mp4
Beta Was this translation helpful? Give feedback.
All reactions