Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Reset button in settings section does not reset the settings!
- This topic has 17 replies, 2 voices, and was last updated 6 years, 11 months ago by
Ernest Marcinko.
-
AuthorPosts
-
April 14, 2019 at 9:19 am #22146
DivineSites
ParticipantWe have the reset button in the settings section, but it’s not clearing the checkbox as we expect it to do..
It only clears the text in the search box…Is there no button to completely reset the filters?
https://www.screencast.com/t/fLxAqq4dAP
I expect it to remove the checkbox, but it doesn’thttps://www.spectra.co.il/excel-pedia/
Thanks
April 15, 2019 at 8:51 am #22148Ernest Marcinko
KeymasterHi,
I can confirm this is a bug, I was able to replicated on our test environments. The checkboxes does not reset properly, when they are set as ‘uncheckbed’ by default.
We are rolling out an update within 48 hours, I will include a fix for this issue, if that is okay with you.April 15, 2019 at 11:46 am #22150DivineSites
ParticipantHey, great thanks for checking that out and letting me know,
I’ll wait for the update.. Thanks!Oh, and what a great plugin!! One of the best interfaces around.
April 17, 2019 at 3:01 pm #22207DivineSites
ParticipantHey, Is this the update that was released today? Becuase I checked and it hasn’t solved our problem..
One more part to this.. We have the results set to only display once someone chooses an option (either writing in the search or using the filter)..
If these are reset, then we want all the results to go back to their initial settings again (i.e. all the resutls should be hidden) until the user enters a new search term, or selects something from the filter…Can you let me know if the updated should have worked, and what we can do about hiding the results if all the search and filters have been cleared..
Thanks!
April 18, 2019 at 7:31 am #22225Ernest Marcinko
KeymasterHi,
The update should fix this issue. Make sure to fully clear the site, page, browser, cdn etc.. cache, and it should be visible.
To hide the results after reset, make sure this option is adjusted like so: https://i.imgur.com/cX2wnXS.png
April 28, 2019 at 10:36 am #22347DivineSites
ParticipantHi Ernest,
The reset button is now mostly working..However, our list is set to DO NOT AUTOPOPULATE, so when pressing the reset button, this should reset it to the default, unpopulated view.
Instead it’s showing results that we do not want..To take this one step further as well, if I select a checkbox, then this list populates. If I unselect the checkbox, so there are no checkboxes selected and no search text, we would also expect the list to be unpopulated.. ie it should only be populated if there is an active filter (search or checkbox)..
https://www.screencast.com/t/GkJ3hqdLxAyU
Can you please let me know how to achieve this?Thanks
April 29, 2019 at 8:26 am #22356Ernest Marcinko
KeymasterHi,
Make sure you then set the reset button action to do nothing here: https://i.imgur.com/Ft7aaii.png
Unfortunately the filters action cannot be changed to not trigger the search when changed to the initial state though.April 29, 2019 at 8:53 am #22358DivineSites
ParticipantHey Ernest,
thanks.. the button is already set as you recommended..
In this video you can see more closely the problem..If i click on the green reset button, then the results stay.. but if I click on the black X next to the search, the list becomes unpopulated..
https://www.screencast.com/t/fVBHbSoOLaThe reset button should behave the same as the X..
Is there any way we can identify if there is an active filter at any given time?
And is it possible to get rid of the X when there is no active filter?
Like in this video:
https://www.screencast.com/t/rDnDGT953Thanks!!
April 29, 2019 at 9:36 am #22359DivineSites
ParticipantActually, sorry I made a mistke.. I had tried changing the reset buttona action to “Nothing”, but it actually makes it do nothing..
it just removed the checkboxes, but it doesn’t reset the list! It stays on the same filter..So in the previous video it’s set to trigger the live search, in this video it’s set to do nothing (the text that appears is the ‘no results found’ text’)
https://www.screencast.com/t/ZGzSJpSLlEApril 29, 2019 at 2:31 pm #22366Ernest Marcinko
KeymasterHi,
Okay, I think I get it now. You want it to close the results box, just like clicking on the “X” close icon. Is this correct?
It might be possible via using a custom code to close the search results when it’s pressed.May 1, 2019 at 2:58 pm #22417DivineSites
ParticipantYes Ernest, this is exactly what I want to achieve.
If there is a custom code to close the search results box, that would really help..
But I don’t understand the “Do Nothing” option.. it literally does nothing without even reseting the search filters. Is the idea that someone has to click on SEARCH for the affect to happen?
In that case I guess we want to change it to “trigger live search” and add your custom code to also close the search results.Basically the client wants it so that if nothing is selected in the filters (or the reset button is pressed) then no results would be show.
Thanks
May 2, 2019 at 9:38 am #22434Ernest Marcinko
KeymasterHi,
The ‘do nothing’ will reset the filters to the initial values (as on page load), but then does not trigger the search bar, right now you have it that way. You should leave it as it is right now, and also add a custom code.
Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_action('wp_footer', 'asp_close_on_reset'); function asp_close_on_reset() { ?> <script> jQuery(function($){ $.xhrPool = []; $.xhrPool.abortAll = function() { $(this).each(function(i, jqXHR) { // cycle through list of recorded connection jqXHR.abort(); // aborts connection $.xhrPool.splice(i, 1); // removes from list by index }); } $.ajaxSetup({ beforeSend: function(jqXHR) { $.xhrPool.push(jqXHR); }, // annd connection to list complete: function(jqXHR) { var i = $.xhrPool.indexOf(jqXHR); // get index for current connection completed if (i > -1) $.xhrPool.splice(i, 1); // removes from list by index } }); $('.asp_sb').on('click', '.asp_reset_btn', function(){ $('.proclose').click(); $('.proloading').css('display', 'none'); $.xhrPool.abortAll(); }); }); </script> <?php }This is not the best solution, but it should be okay.
May 2, 2019 at 9:56 am #22438DivineSites
ParticipantHey Ernest,
Thanks for the code, I checked it out now and it’s working fine!Just with regards to when someone activates a checkbox filter, and then removes the checkbox, so there are no more active filters or search..
Would it be possible in this case to use the code you sent to hide the results?Is there a way to identify if there are any active filters on the page?
Thanks
May 2, 2019 at 12:18 pm #22444Ernest Marcinko
KeymasterHi,
At the moment, I’m afraid that is not possible. I think I will add an API function to somehow check if the search is at it’s initial status, so that it can be implemented in the future.
May 21, 2019 at 3:20 pm #22794DivineSites
ParticipantHey man, any idea when this API function will be ready?
And if it would be something I could use to trigger the JS function that you sent?
thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.