- This topic has 13 replies, 3 voices, and was last updated 9 years, 10 months ago by .
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Search area is not update when category archive loaded by Pjax
Tagged: ajax
Hey Yoshhiro
I have just noticed what you mean 🙂
So, when clicking category archive from this page:
http://jobboard.yoshihiromizuta.com/jobs/157/
The page is refreshed, but S&F is not refreshed, so the correct category is not preselected in the form.
I’m afraid we have no “easy” way to update the search form, but I guess you must run some custom javascript after every page load in your theme.
So in your theme, you must find an event, which is triggered every time an ajax page load occurs.
If you can find this, then you must detect the current page, grab the jobs cat from the URL:
http://jobboard.yoshihiromizuta.com/jobs/jobs_cat<strong>/1/</strong>
And then manually update S&F form to select the correct cat:
var jobs_cat = 2; //this should be taken from the URL, when the page update with ajax
$('.searchandfilter .sf-field-taxonomy-jobs_cat input[type="checkbox"][value="'+jobs_cat+'"]').prop("checked", true);
To do all this is quite tricky but it is possible.
Thanks