ehbfa
Open up a modal from a dashboard widget
I did read those docs. But I think we are talking about two different things? This is the code of my widget:
And this is the contents of the view;
Now I am probably missing something, but where to place an action in this logic? I want that <button> to somehow open a modal, or however that works 🙂
I tried to do something with that $dispatch, but couldn't figure out how to do that or get that to work 😦
47 replies
Open up a modal from a dashboard widget
Sorry, can you please dumb this down for me? Call an action from where, from within that widget? And use the ->view() on that action..? And that view then has to be the modal html? Or the content that needs to be in that modal?
47 replies
How to add a CSS class to a v3 widget?
It seems adding a <div> around the entire blade view contents and add the needed classes in that div worked. But it is still a bit weird to do it like that?
Adding a class attribute to the component tag
<x-filament-widgets::widget>
did not work, it is ignored/replaced
Using {{ $attributes->merge(['class' => 'test-class']) }}
on the component tag did not work either, gives the error: Call to a member function merge() on null
.
I did see there was a $component var, which did had an attributes property. But doing the merge via that way (<x-filament-widgets::widget {{ $component->attributes->merge(['class' => 'test-class']) }}>
) I got the error syntax error, unexpected token "endif", expecting end of file
.
So not sure what the correct approach would be? For now this is working with just a regular div around the entire blade template: <div class="katoo-plus-themes-widget col-[--col-span-default]" style="--col-span-default: span 2 / span 2;">
- but that doesn't feel right... So I'm sure I'm missing something obvious 🙂8 replies
getHeaderWidgets on simple Resource
@lambertn33 you can put widgets in a modal with custom code in a resource (not sure about a simple resource, haven't tested that). I had to do a similar thing. I made a custom action in my resource:
Then I made that blade view with this content:
7 replies
getTableColumns with conditional columns based on the record/row parents type
Just made a new ImageOrTextColumn, and a view which now contains:
@if ($getRecord()->setting->type == 'image')
@include('tables::columns.image-column')
@else
<div>
{{ $getState() }}
</div>
@endif
5 replies