Bulk actions with parameter #253
eswachsman
started this conversation in
Feature Requests
Replies: 2 comments 3 replies
-
There is nothing like this currently, you just get an array of the primary keys of selected rows to work with. |
Beta Was this translation helpful? Give feedback.
2 replies
-
I would love to see this as well. My thought you could define array of options and then a message, and then have a modal pop up with a custom message. public array $bulkActions = [
'exportSelected' => 'Export',
['assignToUser', 'Assign to User', 'assignToUserOptions', 'Please choose the user that these records should be assigned to.'],
];
public function assignToUser($userId)
{
if($this->selectedRowsQuery->count()) {
// map over selected rows and update the assigned user to the $userId
}
}
public function assignToUserOptions(): array
{
return User::pluck('name', 'id')->toArray();
}
@rappasoft if I made a PR for this, would you be willing to accept it? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I might be missing something, but is there a way to execute a bulk action with a parameter. So, for example, I have an "assign to user" action and I want the user to be able to select which user to assign the records to.
Is there something like this already?
Beta Was this translation helpful? Give feedback.
All reactions