F
Filament8mo ago
Baspa

ColumnSpan not working at all

The columnSpan on widgets seems not to work at all. I defined them as follows in my Dashboard.php page:
class Dashboard extends \Filament\Pages\Dashboard
{
public function getColumns(): int|string|array
{
return 12;
}

public function getWidgets(): array
{
return [
WeatherWidget::class,
ClockWidget::class,
LinkWidget::class,
];
}
}
class Dashboard extends \Filament\Pages\Dashboard
{
public function getColumns(): int|string|array
{
return 12;
}

public function getWidgets(): array
{
return [
WeatherWidget::class,
ClockWidget::class,
LinkWidget::class,
];
}
}
The Weather widget for example:
<?php

namespace App\Filament\Widgets;

use App\Cache\WeatherCache;
use Filament\Widgets\Widget;
use Illuminate\Support\Carbon;
use Illuminate\Contracts\View\View;
use App\Domain\Widget\Actions\GetWeather;
use App\Domain\Widget\Actions\GetForecast;

class WeatherWidget extends Widget
{
public array $data;

protected int | string | array $columnSpan = 'full';

protected static string $view = 'filament.widgets.weather';

public function render(): View
{

return view(static::$view, $this->getViewData());
}

public function mount(): void
{
$this->data = WeatherCache::get(update: true);
}
}
<?php

namespace App\Filament\Widgets;

use App\Cache\WeatherCache;
use Filament\Widgets\Widget;
use Illuminate\Support\Carbon;
use Illuminate\Contracts\View\View;
use App\Domain\Widget\Actions\GetWeather;
use App\Domain\Widget\Actions\GetForecast;

class WeatherWidget extends Widget
{
public array $data;

protected int | string | array $columnSpan = 'full';

protected static string $view = 'filament.widgets.weather';

public function render(): View
{

return view(static::$view, $this->getViewData());
}

public function mount(): void
{
$this->data = WeatherCache::get(update: true);
}
}
The page flickers a millisecond showing the correct width of the widget but then immediately returns to 1/12 col span for the widgets. Any idea how this might come?
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server