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\Grid and addCondition to display a given Role and add a User.
- Also we can almost out of the box display the
Role list of a User and 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.
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
UserandRoleandUserhasManyRole.\Atk4\Ui\GridandaddConditionto display a givenRoleand add aUser.Rolelist of aUserand add one using the same method.My question is : how to use
$grid->addSelection()to mass-attribute aRoleto a selected set ofUser? (Which enable to use grid filtering and sorting)In the demo there is a call to some javascript
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.