reorder search result

Home Forums Calendar Products Events Calendar PRO reorder search result

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1014609
    oceanfit
    Participant

    HI,

    I added a custom field to event post type using ACF plugin to add the ability to mark a featured event.
    everything works fine and I reorder the events by jQuery to display the featured events at top of the list as you can check here
    http://dev.oceanfit.com.au/oceanswims/

    The problem is when you search for an event using the filter bar, it return the result by AJAX so my jQuery code won’t work.
    my question is how can I reorder the result of ajax search?

    thank you

    #1014707
    George
    Participant

    Hey @oceanfit,

    This question is unfortunately hard to answer because we do not offer support for custom code – and so the most helpful thing to solve this would be delving right into your event-ordering JS itself to see what’s going on, but we do not provide that level of support.

    I’m sorry about that! But one thing that might help is jQuery’s custom event triggering so that when a filter on your site is clicked, an event is triggered. Then you can fire your reorder code on this event. For more information and an example of this, check out these resources:

    jQuery Documentation
    http://api.jquery.com/trigger/
    https://api.jquery.com/change/

    Stack Overflow Example
    • http://stackoverflow.com/questions/4247264/how-to-trigger-jquery-change-event-in-code

    I hope this isn’t so vague that it’s useless – if you post your event-reordering JS into a Gist at http://gist.github.com and then share a link to that Gist here, I can try to take a look at it if our support flow lulls a bit and I have the time to.

    Thank you!
    George

    #1014808
    oceanfit
    Participant

    Thank you,
    I solved it by using ajaxSuccess event to reorder the events after the ajax return the search result
    http://api.jquery.com/ajaxSuccess/

    #1014895
    George
    Participant

    Ah, great idea! Thanks for sharing that update – and apologies for not suggesting it myself 🙂

    Best of luck with your site,
    George

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘reorder search result’ is closed to new replies.