The columnSpan on widgets is not working
It seems like the
columnSpan
property on the Widget class does not have any effect at all unless I'm using full
as value. For example 6/12
or 4/12
does not work and displays the widget as 1/12
.
I have this Dashboard page:
And this widget:
But the width of the widget is always set to 1/12. Unless I set it to 'full'. How should I set it properly? I can't find clear documentation on the website about this.7 Replies
What about the grid columns that you are using to display widgets?
https://filamentphp.com/docs/3.x/panels/dashboard#customizing-the-widgets-grid
What do you mean? I defined the amount of columns, right?
could you share an image that you are trying to achieve?
The ideal situation would be for me to dynamically define the sorting and columnSpan of each widget. But for now, a hardcoded variant would be fine.
Let's say I have defined the amount columns of the dashboard page to be 12. I want to be able to show 3 widgets in a row with each a different columnSpan:
1. Widget Foo: 2/12
2. Widget Bar: 6/12
3. Widget Baz: 4/12
See the image for an example of how that would look like.
The widgets should be placed in the header, so I created the Dashboard page like this:
When I define the
columnSpan
in the Foo widget it does not respect its value but set the columnSpan to 1 (as you can also see in the image, the three widgets all have columnSpan somehow set to 1):
When I set the columnSpan to
full
it does respect its width. But for the other sizes it somehow does not 🤔protected int|string|array $columnSpan = 2
, actuallyAh lol, that worked
Thanks!