F
Filamentericmp

TextColumn action->button not working as expected

Tables\Columns\TextColumn::make('asdas')
->label('See 2 items')
->action(
Tables\Actions\Action::make('test')
->button() // it doesnt show it as btn, should it?
->modalContent(fn (Response $record) => view('test', [
'field' => [],
]))
->modalFooterActions(fn () => [])
,
)
Tables\Columns\TextColumn::make('asdas')
->label('See 2 items')
->action(
Tables\Actions\Action::make('test')
->button() // it doesnt show it as btn, should it?
->modalContent(fn (Response $record) => view('test', [
'field' => [],
]))
->modalFooterActions(fn () => [])
,
)
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:
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.
No description
E
ericmp12d ago
bump ^^
DK
Dennis Koch12d ago
Column actions don't render any link or button. They are an action for the whole clickable area.
E
ericmp12d ago
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?
DK
Dennis Koch12d ago
Hacky way: ->formatStateUsing(fn () => new HtmlString(Blade::render('<x-filament::button>Button</x-filament::button>)). Cleaner way: View file 😅
E
ericmp12d ago
yeah 🫣 using the hacky way, but it doesnt trigger the modal
No description
DK
Dennis Koch12d ago
You still have the ->action() part?
E
ericmp12d ago
yes
DK
Dennis Koch12d ago
Did it work before?
E
ericmp12d ago
yes wait, the format state using should be set in the action or in the textcolumn? ive set it in the textcolumn
DK
Dennis Koch12d ago
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.
E
ericmp12d ago
no console errors hmmm i guess the btn doesnt have any onclick action attached or smth
DK
Dennis Koch12d ago
It should be on the column. That's why you have ->action on the column
E
ericmp12d ago
okay i found something wierd. there is 2 btns
No description
E
ericmp12d ago
the above one has the wire:click
No description
Solution
DK
Dennis Koch12d ago
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.
E
ericmp12d ago
ohh. okay yeah. ill do the plan b hehe - custom column thanks dennnnnnis (:
Want results from more Discord servers?
Add your server
More Posts
Filament resource not showing on websitei made a migration, model and now a resource i followed a tutorial to see how i can make a resource How to translate filament filepond placeholder?I've tried to find it in the vendor, but idk how to translate itFill Select on relationmanager creation formHow can i pre-fill parent relation selector on a create form on a relationmananger? On the Practice Help with github actionsI copied the workflow file from filament: ```yml name: phpstan on: push: pull_request: jobs: File upload preview green gradientHow do I remove the green gradient so that I can see the whole logo while uploading it ? ```<?php Close Modal Custom Page Livewire Not Working CorrectlyI make Custom Component Livewire, i have action with modal, but i close modal with button close is cExport to Excel - sub folder does not get url correctly.My app referer to the sub directy as : domain.com/demo/meterbill -> link to public folder in LaravelHow I can create Form or Table in another classF.E I want to create another class with form or tableUpdate each repeater field 2 fields outside the repeaterI'm playing around with creating a invoice in Filament and I've created a form that has multiple fieCan't access User profile "isSimple:false" on Team tenantHi. Trying to get to User's profile (http://app.test/dashboard/profile) This works public functHow to handle API error response?I have a resource, once you have create/update/delete action, it will call an API endpoint. How can Select Filter List TruncatedHi Guys, I have a select filter which has more then 50 options, however the list has been truncated Column relationships problemHey ! In a relation manager resource, i have this code : ```public function table(Table $table): custom themeHello, when I create a custom theme (php artisan make:filament-theme) and configure my vite.js fToggle-columnIs there any way to make toggle-column from scratch on a custom page ?$getAction() and visibilityWhen using ->registerActions() on a Form or Infolist component, it seems that visible() and hidden()Modal action or table inside formMy use case is a CRM application where each resource only has an edit screen. A list of related resoCustomizing Data Insertion with Filament's Import ActionHello, Regarding the import: https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import Is iCount SaleItems sold by Product IDHello, I have a Sales Resource with (hasMany) SaleItems Resource which selects a product to sell froMissing required parameter for View routeI have just found out the wonder of Repeaters, and after adding one to a form, the first time I subm