-
Notifications
You must be signed in to change notification settings - Fork 821
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
Persist the filter for model admins, and pages list view #3542
Persist the filter for model admins, and pages list view #3542
Conversation
491ccc9
to
4ddfad9
Compare
…, and back link to persist the filter for the model admin, and pages list view.
4ddfad9
to
c30bbbf
Compare
This feels like a really heavy-handed way of doing this, and the change of the HTML ID isn't something that I think should be necessary (or included in 3.1). A few thoughts:
Would be good to get some views of other devs on this. |
I tried to go with the most unobtrusive code change I could think of to limit the surface area of the change. If you think that that's the best approach, I'd be more than happy to modify the pull request or create a new one. I think this bug really needs to be fixed, we have a client that has a site with thousands of pages and editing those in the ModelAdmin is horrendous without the filter persisting, at least. We also tried to get the Pagination to persist but could not find a clean (non hacky) way of doing it. |
Hey @glenn-bautista. I’ve had a small brainwave here. A possible solution here is to replace the “Back” button with a I’ve done a quick and untidy proof of concept in kinglozzer@1814288, what do you think? |
@kinglozzer nice idea :) Those damn CSS selectors for behviour are horrendous, though... they should just have a single js hook class that denotes their behaviour... |
Now that we have 3.2, is this an appropriate solution? The HTML ID of forms have all changed anyway. I think that this is a bug as it standards, as user expectations are not met with the action on the back button. |
We've just released a module which does this: https://github.com/Little-Giant/silverstripe-persistentgridfield |
This definitely needs some attention in the core - thanks for the module in the mean-time |
We'd be happy to port this across to core but the way we've had to do it in the end is really hacky. It definitely requires a bit more thinking about how |
Created an alternative module to enable some form of states in grid views. Instead of using php+memory/hashes (see @stevie-mayhew) I've tried to get by just using JS utilising sessionStorage. Stateful per tab, state resets when navigating across "modules". See: https://github.com/novatio/silverstripe-statefulgridfield (WIP, developed in SS 3.2). Any thoughts on this approach? The main issue is that sessionStorage is a client side thing, so the gridviews always fetch the initial listing and right after that the reload (with the previous state) is triggered. |
Why is using the built in |
I wanted to keep track of the state per browser tab and at the same time keep track of "module states" per tab (e.g.: when you navigate from assets/* to settings/* and back again: you'd want the state for any GridViews in assets/* to have been reset and not retain any previously used states... the user is expecting a 'clean slate'). I thought that this would not be possible with |
@gavro I'm talking about You might right that this state will leak across tabs... but I'm not certain - worth a check? I think implementing sessionStorage would be quite tricky and lead to a lot of overhead about when to clean it up and making sure you don't go over the browsers undefined limits in this area... |
Fix: Append the 'q' get variable to the GridField ItemEditForm action, and back link to persist the filter for the model admin, and pages list view.
Found the issue here: silverstripe/silverstripe-cms#503