Ce fil est résolu. Voici une description du problème et la solution proposée.
Problem:
Bootstrap radio buttons with Ajax
Solution:
When you visit view's "Search and Pagination" section's JS box - you will see a button "Frontend Events". When you click it it will allow you to choose ajax callback events.
This support ticket is created Il y a 5 années et 2 mois. There's a good chance that you are reading advice that it now obsolete.
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I want to show Ajax radio button filtered search as Bootstrap buttons and active button should look a bit different. (Radio buttons are so 90's somehow, don't you think? That's why I wonder a little why it is so hard to show the buttons more modern way.)
I'm almost there, but not quite 🙂 I need to add class .active to the chosen button and now when I choose a value it filters ok, and adds the .active class after "submit" ("Full page refresh when visitors click on the search button with input values auto-updating"), but not with Ajax ("AJAX results update when visitors change any filter values") .
Hello. Thank you for contacting the Toolset support.
When you visit view's "Search and Pagination" section's JS box - you will see a button "Frontend Events". When you click it it will allow you to choose ajax callback events.
Refer this image:
=> hidden link
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
*/
jQuery('.bootstrap-radio').find('input:checked').parents('div').addClass("active");
jQuery('.bootstrap-radio').find('div').on('click',function(){
jQuery('.bootstrap-radio').find('div').removeClass('active');
jQuery(this).addClass('active');
});
What if you try to adjust the JS code you shared within this event and check if that help you to resolve your issue.