Travis
Bulk actions which is only visible when 2 rows are selected
It gets the table's filter state for a filter named, "state", which may be confusing at first. 😅
Then, it looks to see if it has "values". If you have a normal select filter, then this would be "value", I believe.
Then, for my logic, I want to check to see if only the "pending" state is selected. If so, then this is when I want to make the "approve" bulk action visible. You may have different logic.
For the bulk "revert" action, for example, I want it to be visible if the user has selected either the "approved" state or the "rejected" state.
12 replies
Bulk actions which is only visible when 2 rows are selected
Sure.
Keep in mind that this is using a multi-select filter, where the user can choose any combination of three states: pending, approved, and rejected.
I changed a few names and added some comments to try to help.
12 replies
Bulk actions which is only visible when 2 rows are selected
I found a solution, but not the one I was looking for.
I basically did the same thing as the built-in force delete and restore actions do, which relies on the presence of a filter.
So, in my case, I have a multi-select filter with different states: pending, approved, and rejected.
I examine the filter and only allow the various actions, depending. It's only when the pending filter is present that the approve/reject actions are enabled, for example.
Ideally, I would get all of the selected items and examine them to decide what should be allowed, but I haven't figured out how to do that yet, if it's even possible. 🤷♂️
12 replies
Bulk actions which is only visible when 2 rows are selected
I'm looking for a solution to this, too.
It seems difficult to get the selected records upon a change in row selections.
I'm going to take a close(r) look at the built-in bulk actions to see if they offer anything like this (like restoring/trashing deleted resources).
12 replies
Max excution timeouts
I'm getting a similar exception when dispatching a job on a resource create. It's meant to be a long-running task that's dispatched, but I'm working locally and using sync at the moment.
I will try to use a different queue to see if that helps.
In the meantime, if anyone can tell me what this 30 second timeout is or where one can change it, I would appreciate it.
25 replies
"Maximum execution time of 30 seconds exceeded" in hasEvenNumberOfParentheses Function
Did you ever figure this out?
I'm also having the same problem and can't pin down which timeout is set to 30 seconds and where it can be changed.
As for where it's happening for you, I would suggest you re-run things. For me, it's failing at different places in the code, depending on where, exactly it is, when the timeout occurs. I am guessing that yours is "random" just like it is for me.
3 replies
Can I use import options to allow the user to define the CSV delimiter?
Well, I don't know how I missed it, but I can see that ImportAction has both the options and the CSV delimiter, which can be a closure, but can it accept options?
If not, wouldn't that be helpful to submit a PR that updates the
evaluate()
call to pass along the options?4 replies
Reusing actions
Thx. I've considered that. I have a Table Action action that uses the setup to get everything working nicely for a table record that I want to be able to rate. It works great. But, many of the "handlers" take a "record", which is the record in question. I am not sure how I can have a non-table action work without this being provided.
(Hopefully that makes sense. I haven't yet tried it. I've just got my single Table Action action working. I need to try to extract the setup functionality to a trait and then try it with the livewire component action, which uses
Filament\Actions\Action
and instead of taking $record
, it uses the livewire component's public $ratable
attribute/property.)15 replies
Reusing actions
What about an action that can be used as a table action or a "standalone" action on a livewire component?
I have the same functionality, rating a ratable resource, that displays a modal dialog box, and allows a user to enter/clear a rating.
It seems I need to extend a Table Action to use as a table row action, which makes sense, but then it's not something that can be used on the standalone livewire component.
I'm thinking I need multiple action classes, each extending the appropriate filament action class, but then it's not quite clear which way is the best way to reuse all of the basic/shared functionality.
15 replies