Forums › Forums › Search & Filter Pro › Need to show all options of dynamic dropdown filter on initial page load
- This topic has 13 replies, 2 voices, and was last updated 8 years, 12 months ago by
Trevor.
-
Anonymous(Private) April 8, 2016 at 8:54 pm #42092
Hi,
I have a search and filter form with two dropdowns. I have AJAX running on the form, so the first dropdown will reload the results and the second dropdown hides empty results. Basically the second dropdown will only show results pertaining to the first dropdown.When the page initially loads, the first dropdown has the option ‘All Items’ selected. However, the second dropdown does NOT show all its options, which is what I’d like it to do. In order for the second dropdown to show all options, I have to first select another item from the first dropdown, then select ‘All Items’ again from the first dropdown. This is what populates the second dropdown with all options.
Is there any way I can trigger this on page load, so that the second dropdown shows all its options initially when the page loads?
Anonymous(Private) April 11, 2016 at 4:44 pm #42310Hi Trevor,
Unfortunately I don’t have a live URL, but I can provide additional information.The select dropdowns are based on post metadata. Within a blog post form, I have JS/ajax set up with Advanced Custom Fields so that when a user selects a manager from the first dropdown, the second dropdown of employees changes dynamically to reflect employees that specifically report to that selected manager. Because of this setup, Search & Filter automatically filters my dropdowns (if I choose to hide empty results), because the results pertaining to a specific manager will only exist for the employees that are filtered within the blog form, does that make sense?
So my question is: when I go to my blog on a browser, and Search and Filter displays on the side, I have 2 dropdowns for Manager and Employee. The first dropdown for Manager has “All Items” selected by default. The second dropdown for Employees has “All Items” selected by default as well. However, if I happen to click on the second dropdown to see all Employee options, it shows 1-2 random employees, instead of all employees, which I’m hoping for it to show since the user hasn’t selected a Manager yet.
When the user selects a Manager from the Search and Filter dropdown, the Employees dropdown is then filtered correctly. If the user then selects “All Items” again from the Manager dropdown, I am able to see ALL Employee options. This is what I’m hoping for on page load. So I’m wondering if there is a way to show all Employees when my blog loads up, or to trigger a Manager selection manually, so that I can see all Employee options on page load?
Anonymous(Private) April 11, 2016 at 7:19 pm #42334Ah, ok. That would be great. Do you know when the next official version will be coming out, or if you do send the zipped version, do you know if there will be any changes made to it before the release of the next official version? I’m wondering if it’s worth waiting until then, or just installing the new version now.
Tina
Anonymous(Private) May 18, 2016 at 12:08 am #45815One more thing – I noticed that the employees that are initially shown in the dropdown (on page load) are employees associated with the first Manager in the Manager dropdown (remember how selecting a manager will dynamically populate the employee dropdown). So, that might lend some insight into what is going on here, or confirm that this is the same glitch you have seen and fixed from before.
-
AuthorPosts