-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute php callback on Grid->addSelection() for multiple selection #1727
Comments
I finally managed it by using javascript to set value of an hidden form input in a static modal.
|
@mhuser is there anything to be improve in atk4/ui? |
Hello @mvorisek thank you a lot for asking! I find atk4/ui is a really great tool! When starting to use
And all of this even without writing any JavaScript, which is incredibly nice! However, when it come to performing an action on a selection of records, things escalated quickly: To be honest, I fear this is not very helpful for an individual with limited atk4/ui skills like me. The solution above works, but the code required for it is verbose and error-prone when several actions exist. In comparison, the other atk4/ui lines look nice. I have later discovered this documentation making an exemple of multiple selection in In my wildest dream, there are two elements that could be improved with
|
Thank you for the perfect analysis.
If you can, please submit a PR with an improvement.
opened #1877, it is a separate issue |
Thank you. Let's try it. This will enable me to better understand what is going behind the hood and I will be the first to benefits from it. |
I know that the question may sound silly, but once I have cloned atk4-ui master on a development web server, how can I get the demos to work? I guess there is something to do with composer to setup autoload. |
run |
Thank you so much ! |
OK, I have the running demo and the sqlite db was populated thanks to your composer hint. |
in the latest develop version it should be configured automatically in: Lines 630 to 655 in b1b2268
please describe:
|
Apache HTTP Server 2.4 and PHP 74 on a local NAS server.
|
I will take a look. for now, edit the App cdns here Line 147 in b1b2268
|
Thanks to you I am now up and running! foreach ($app->cdn as $k => $v) {
if (str_starts_with($v, '/') && !str_starts_with($v, '//')) {
$app->cdn[$k] = str_replace('/volume1/web', 'https://etml-elo.diskstation.me', $v);
}
} |
Draft started in #1920 |
@mhuser before Line 641 in b1b2268
and navigate to the homepage and please post here:
[1] can be analysed by linux |
I think it is my configuration that is the issue (the server is on a Synology NAS setup from their package) |
Thank you a lot for the data! I will do my best to make it working. As there is no modrewrite, it should be possible :) |
I was able to reproduce with the following filesystem configuration:
and
at the beginning of the
and when Line 652 in 7102df9
more debug:
shows
|
Looks similar to the issue I faced ! |
please test if adding:
at Line 651 in 7102df9
fixes the path calculation, eg. fixes #1727 (comment) |
@mhuser thank you for reporting the problem and helping me to understand it, fix merged in #1936, I was litte worried about |
@mvorisek This sounds great! Thank you a lot for the quick fix! |
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
andRole
andUser
hasMany
Role
.\Atk4\Ui\Grid
andaddCondition
to display a givenRole
and add aUser
.Role
list of aUser
and add one using the same method.My question is : how to use
$grid->addSelection()
to mass-attribute aRole
to 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.
The text was updated successfully, but these errors were encountered: