jimarick
Select field - Multiple & Search
When I have a select field with ->multiple() and ->searchable().
When I search and click to add an item the search automatically resets, so if there are multiple items I want to select from the search, I have to write the search term again. Is there a way to persist the search so I can select multiple items without reseting the list?
6 replies
Chart widget not showing until page refresh
Hi, hope someone can help.
I have a laravel app with livewire and filament. I have created a new livewire component page called Offers. This offers page has a small filament ChartWidget component within it called OfferChart.
When I first load the Offers page, the chart within the OfferChart component does not load. The component itself is visible as white space on the page, but the chart within it is not visible.
When I refresh the page manually using the browser refresh button, the chart appears, and stays there. Any ideas why the chart does not appear on first render?
For information:
The Offers livewire page which inserts a livewire component with:
@livewire(\App\Livewire\OfferChart::class)
The OfferChart component is very simple:
<?php
namespace App\Livewire;
use Filament\Widgets\ChartWidget;
use carbon\Carbon;
class OfferChart extends ChartWidget
{
protected static ?string $maxHeight = '200px';
protected static string $color = 'success';
protected function getData(): array
{
return [
'datasets' => [
[
'label' => 'Number Offered',
'data' => [1,2,3],
],
],
'labels' => [1,2,3],
];
}
protected function getType(): string
{
return 'bar';
}
}
2 replies
Customise color depth?
I have an action with: ->color('danger')
I'm happy with the color itself, but I want to change the 'depth/shade' of the color (ie. bg-red-300 vs bg-red-700).
When I look at the 'Trait HasColor', it has the following comment:
Parameters:
string|array{50: string, 100: string, 200: string, 300: string, 400: string, 500: string, 600: string, 700: string, 800: string, 900: string, 950: string}|Closure|null $color
This suggests to me there is a way to pass through the depth of color I want, but I haven't been able to work out how. I'm probably being stupid. I
would have throught it would be something like:
->color('danger', 200)
Any ideas?
2 replies