-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
ActionColumn buttons (by default) reset filters #15
Comments
Need a test that verifies such behavior i.e. sorting and filtering is taken into account when generating URL for an action button. |
I'm not clear on this part. As a result the action is performed (navigate to view/edit/delete). And it's depending on the action which page is rendered next. Assuming the default markup for a Gii CRUD generated page: I understand that the current parameters could be passed (to the delete button for example) to allow redirect to the index page and end up on the same view (page X, filtered by field Y and sorted by field Z) as before of clicking the delete button... but I think it's an specific behavior that the developer should be able to choose to use or not. This behavior could be added as an option:
at |
Currently URL for action buttons don't generate automatically. Is such generation necessary? If yes, by what logic should it work? |
It's about redirect that happens after an action is done, i.e. returning to the same filtered view after deletion is done or editing is done.
There are edge cases, though, such as deleting a record so the page no longer exists. |
I think it can safely be done after initial release. |
It can be done something like this.
|
I think I can do this task. |
@glpzzz any luck with it? |
Not yet. WIP |
What steps will reproduce the problem?
What is the expected result?
Filters/Sorters should be saved/restored after clicking buttons in action column.
What do you get instead?
All filters reseted, after clicking actionColumn button.
As temporary solution, it's possible use closure in action column
Additional info
Method
createUrl()
also used inPagination.php
,Sort.php
, but in these classes for creating Url is used current parameters from request, so we don't have problems with resetting filters/sorting.But for action column we should use slightly different solution because, creteUrl will be executed for each row/column, so we need params 'caching' (may be in GridView widget) from request for avoiding
$paramsFromRequest = $request instanceof \yii\web\Request ? $request->getQueryParams() : [];
calculating in each row.The text was updated successfully, but these errors were encountered: