Forums › Forums › Search & Filter Pro › Multiselect: Empty terms are still active
- This topic has 13 replies, 3 voices, and was last updated 7 years, 1 month ago by Ross.
-
Anonymous(Private) September 28, 2017 at 12:59 pm #133723
Dear Trevor, first, great plugin! It works really great, nearly perfect.
One problem:
I use two taxonomie filter, radio for categories and multiselect combo for tags (Chosen, with active “hide empty terms”).Well, if I change the category, the empty terms in the multiselect are removed, but are still active.
The result is not updated and do not show entries.I have try to fix it with the following snipped, but that’s not working.
$(document).on("sf:start", ".searchandfilter", function(){ // Update on change cats $(".searchandfilter").trigger("chosen:updated"); console.log('update'); });
Do you have an idea how I can update the result after changing categories?
Best,
KaiTrevor(Private) September 28, 2017 at 7:37 pm #133835Wait, I just re-read the thread again. Is this your issue ….
You make some selections, and because of those selections, some fields are completely empty, because you have Auto Count ON and Hide Empty?
If so, that is how the plugin works at this time. You could use some custom javascript (but I would not know how to code this myself) to detect that they are empty and hide them. The FAQ page has code examples on how to detect when Ajax has fired, and your code would go inside that.
Anonymous(Private) September 29, 2017 at 11:48 pm #134065For example: If you select the category “Unterrichtsbausteine” and multiselect “Medienkompetenz”, then change the category to “Workshops” … the empty tags are now removed but no result is displayed.
Only when you press now Submit manually, the correct result is displayed.So after the Ajax-Submit a second submit is required.
It works with this snippet, fired after Ajax-Submit. But it’s a little bit dirty. 🙂
setTimeout( function() { $( ".searchandfilter" ).submit(); }, 1000);
-
AuthorPosts