Issue with modal in actions
Hi, I'm building a table with a custom livewire component with table builder in a custom page.
The problem is when I add a action in the table and i want to open a modal with a form to get data before exec the action. It doesn't open the modal.
I link the Custom page and the visual-testing-baselines component files.
Solution:Jump to solution
Returning all the fields and deleting the getTableQuery() function has already worked for me.
```
protected function getTableQuery(): Builder|Relation
{
if (!empty($this->project)) {...
15 Replies
As you can see in the VisualTestingBaselines.php i'm adding the action by this way:
In other filament tables in the list record it works, but in a component in a custom page with table builder it doesn't works.
Somebody can help me?
Hi, I've just check it out and it's working fine, my code is below
You need to have
<x-filament-actions::modals />
in your page componentThat doesn't works.
The problem I see is as if the Actions themselves were broken. It must be due to a lack of some dependency or something because they are painted correctly but when I press they do nothing, as if the script that makes them work was missing.
Even if I remove the modals, and leave only the action, it doesn't work, it doesn't execute the ->action()
Are you using filament panel or you install table package without panel package ?
If you use table outside of panel package, you should install https://filamentphp.com/docs/3.x/actions/installation
Your error is clear, the component is missing
Unable to locate a class or view for component [filament-actions::modals].
I'm in v2. Does that affect anything?
ahhhhhhh
probably, I don't know
I have this 2 packages:
"filament/filament": "^2.0",
"filament/forms": "^2.0",
you shouldn't need both installed like that. 'filament/filament' installs all the packages.
Yes, I remove it. But the problem that I have with the actions in the custom table continues
I have debugged and I have seen that the action breaks here.
vendor/filament/tables/src/Concerns/HasActions.php
I have solved the problem.
The problem was caused because in the getTableQuery() I was not returning the key. That forced me to use the getTableRecordKey() function to set a new one. This meant that the actions could not take the Record.
Solution
Returning all the fields and deleting the getTableQuery() function has already worked for me.