Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Buttons to filter results by year
- This topic has 14 replies, 2 voices, and was last updated 4 years, 1 month ago by
Ernest Marcinko.
-
AuthorPosts
-
April 20, 2022 at 10:48 am #37575
apbalice71
ParticipantHi, we’d like to know if it’s possible to have buttons to filter the search results by year e.g. 2022, 2021, 2020, etc.
April 20, 2022 at 5:02 pm #37600Ernest Marcinko
KeymasterHi,
I’m afraid that type of layout is not possible. You can do drop-down or checkboxes or radio buttons.
April 21, 2022 at 1:53 pm #37619apbalice71
ParticipantMay we ask how do we have radio buttons to filter by year? i.e. selecting 2021 will show only posts from 2021. We only see the date filter with the date picker selection. And can we have both, radio buttons plus date picker at the same time?
April 22, 2022 at 8:50 am #37621Ernest Marcinko
KeymasterOh, I’m sorry, I was thinking it was a custom field type filter with only containing the year. For datetime/timestamp values, or post date filters only the date picker is available, I’m sorry.
April 26, 2022 at 3:05 pm #37651apbalice71
ParticipantThere’s another question concerning the datepicker. When it loads, the year dropdown shows 1999 to 2019. How can we make it show up to 2022?
April 26, 2022 at 3:22 pm #37652apbalice71
ParticipantYou cannot access this content.
April 26, 2022 at 7:42 pm #37653apbalice71
ParticipantHi, we found that it’s related to the setting “Minimal character count to trigger search”. When it’s less than the minimal character, it won’t do anything after filtering by date. We have the following code to trigger search by enter.
(function($){ $('input.orig').on('keyup', function(e){ if (e.which == 13) { ASP.api(1, 1, 'searchFor', $(this).val()); } }); }(WPD.dom));How do we make datepicker trigger search even when it’s less than the minimal character?
April 27, 2022 at 1:42 pm #37655Ernest Marcinko
KeymasterHi,
Well, that is intentional behaviour, you can maybe try this on the datepicker:
(function($){ $('.asp_datepicker').on('change', function(e){ ASP.api(1, 1, 'searchFor'); }); }(WPD.dom));April 28, 2022 at 3:29 am #37661apbalice71
ParticipantMay I ask if it’s possible to customize the datepicker or use something like https://www.daterangepicker.com/?
April 28, 2022 at 4:09 am #37662apbalice71
ParticipantWe also have another question. Is it possible to have the Reset button in filters to only reset the filers but not search field, because it’ll show “no results” when I click reset.
April 28, 2022 at 1:51 pm #37671Ernest Marcinko
KeymasterI’m afraid that may not be possible. However you can change the Reset button settings not to trigger the search afterwards, only to reset everything.
April 28, 2022 at 2:05 pm #37672apbalice71
Participanthow do we make reset not to trigger search?
April 28, 2022 at 2:21 pm #37673Ernest Marcinko
KeymasterThis setting.
May 2, 2022 at 7:21 am #37681apbalice71
ParticipantUnfortunately, we already set to do nothing but it seems it’ll still trigger a search then shows no results on mobile.
May 2, 2022 at 3:40 pm #37690Ernest Marcinko
KeymasterCan you please make sure to clear the mobile device browser cache?
I tired two different mobile devices just now, and they seemed to work okay. The reset did not trigger the search after pressing. Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.