Skip Navigation

[Resolved] Javascript stops working after filter is applied.

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by veraL-2 1 year ago.

Assisted by: Minesh.

Author
Posts
#2702393
Screenshot 2024-06-13 at 11.03.00 AM.png

Tell us what you are trying to do?

I am building a view that allows users to filter through posts on our site. When listing the potential categories users can filter by Toolset adds a hyphen to the beginning of each category title. I'm trying to remove those hyphens using JavaScript at the moment, and the JavaScript works but once a filter option is chosen the JavaScript no longer works.

Is there any documentation that you are following?

No

Is there a similar example that we can see?

No

I provided screenshots of where the hyphens exist on the view.

What is the link to your site?

Link to site: hidden link
Link to page on the site where the view exists: hidden link

#2702456

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - Toolset offered the AJAX event hooks.

Can you please check the following Doc:
- https://toolset.com/documentation/programmer-reference/adding-custom-javascript-code-to-views-that-use-ajax/

And try to add the related JS hook and add your custom JS code within that hook. For example:

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.layout (object) The jQuery object for the View layout wrapper
    */

    /// try to add your custom Javascript code here or use other hooks as required
      
});

Please check the following ticket that might help you:
- https://toolset.com/forums/topic/is-there-a-list-of-frontent-events/

#2702511