If I wanted to update the Elements listing based on an action taken from a plugin, would it be possible to do this?
Setup:
- We're on an Elements listing page.
- We filter the results with a search query.
- We then click an Element's name to move to its individual editing page
The Problem:
Currently in my tests with Google Chrome if I:
- Filter a list by a search query (say
lastName::T*
on the Users listing page), - Click on one of the usernames
- Hit "Back"
My search is not saved, i.e., I'm returned to a non-filtered list.
My workaround to this is to write a simple JS plugin that stores your search query - if populated - when you navigate away from the page. I then re-populate the search query when you re-enter the page but I have to tell Craft to execute it, IE to fire updateElements
.
My current workaround for this is to fire a change
event on the search box if the search query is stored and it's not an Ajax request. It works, it just feels kind of hacky.
So I'm wondering if there's a more native, less hacky solution.