-
Notifications
You must be signed in to change notification settings - Fork 111
Execute php callback on Grid->addSelection() for multiple selection #1727
Copy link
Copy link
Closed
Labels
Description
First of all, I want to thank you for this great tool that is atk4/ui !
Since some time I have a question which I believe does not find answer in the documentation (but maybe I am just blinded).
Let's suppose we have two models User and Role and User hasMany Role.
- It is quite straightforward to use
\Atk4\Ui\GridandaddConditionto display a givenRoleand add aUser. - Also we can almost out of the box display the
Rolelist of aUserand add one using the same method.
My question is : how to use $grid->addSelection() to mass-attribute a Role to a selected set of User ? (Which enable to use grid filtering and sorting)
In the demo there is a call to some javascript
$grid->menu->addItem('show selection')->on('click', new \Atk4\Ui\JsExpression(
'alert("Selected: "+[])',
[$sel->jsChecked()]
));
But I does not understand how to relies on a php callback instead that would receive the selected id list and perform some processing such at foreach the list and create the appropriate role lines or others.
Reactions are currently unavailable