Skip Navigation

[Resolved] What is the Toolset AJAX Completion Event for use in JavaScript

This thread is resolved. Here is a description of the problem and solution.

Problem:

I'm encountering difficulty in reinitializing JavaScript functions after dynamically loading content via AJAX on a custom archive page built with Toolset. I need to identify the event or trigger in JavaScript that signifies the completion of the AJAX call to correctly reinitialize the functions.

Solution:

For block views, there isn't a direct method to identify the completion of AJAX calls. However, if you switch to legacy views, you can trigger an event after AJAX filtering is completed. Follow the steps provided to enable legacy views and refer to the documentation for triggering JavaScript events after AJAX filtering:

- Enable legacy views via "Toolset > Settings > General."
- Utilize the method outlined in the Toolset forum to trigger events after AJAX filtering:

https://toolset.com/forums/topic/trigger-js-event-after-ajax-filtering-finished/#post-477382

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 10 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2686947

Hello Toolset Support

I'm using Toolset on my WordPress site to dynamically update content on a custom archive page using AJAX, without a page reload. This AJAX functionality is for filtering search results. While this is working well, I need to reinitialise certain JavaScript functions after the AJAX content is loaded, and I can't seem to get this to work.

Could you please inform me about the specific event or trigger that I should listen for in JavaScript to know when the AJAX call has completed? I need this to correctly reinitialise JavaScript functions on the newly loaded content.

This is the Archive Page:

hidden link

#2687127

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

There is no such option to find out the complete event in block views. But if you use the legacy views there is an option for that.

Please follow the steps below to enable the legacy views:

- Go to "Toolset > Settings > General".
- Find the "Editing experience" section.
- Check the "Show both the legacy and Blocks interface and let me choose which to use for each item I build" checkbox.
- Reload the browser page.
- Go to the newly added "Toolset > Views" menu.
- There you will be able to edit the views.

For more information:
https://toolset.com/course-lesson/enabling-legacy-version-of-toolset-views/

After that, you will be able to trigger an event name for the Ajax complete using the method below:

https://toolset.com/forums/topic/trigger-js-event-after-ajax-filtering-finished/#post-477382

Thanks.