TextColumn action->button not working as expected
i see like this (see image), but i expected it to be shown as a btn with the primary color as bg , but it doesnt
Solution:Jump to solution
Ah that's why.
->action()
adds a button and they can't be nested. So that doesn't work then. I guess you need a custom column then.16 Replies
bump ^^
Column actions don't render any link or button. They are an action for the whole clickable area.
oh, yeah true hmmm
so how you'd achieve it to make it look like a btn? π€
maybe a custom view there, or what?
if it's a custom view not sure how to trigger a modal there yet
any ideas?
Hacky way:
->formatStateUsing(fn () => new HtmlString(Blade::render('<x-filament::button>Button</x-filament::button>))
.
Cleaner way: View file π
yeah π«£ using the hacky way, but it doesnt trigger the modal
You still have the
->action()
part?yes
Did it work before?
yes
wait, the format state using should be set in the action or in the textcolumn?
ive set it in the textcolumn
In the text column.
Hm. Maybe some logic inside the button component than breaks this? I am not sure what's the best approach then.
no console errors
hmmm
i guess the btn doesnt have any onclick action attached or smth
It should be on the column. That's why you have
->action
on the columnokay i found something wierd. there is 2 btns
the above one has the wire:click
Solution
Ah that's why.
->action()
adds a button and they can't be nested. So that doesn't work then. I guess you need a custom column then.ohh. okay yeah. ill do the plan b hehe - custom column
thanks dennnnnnis (: