Hello,
I am loading Select2 multiselect with a CDN to display options built with Toolset. On page load, the Select box becomes a Select2 box, but after you choose a selection, it reverts back to a regular html multiselect box.
The page is hidden link
Password: potential
Here is the code from my external .js file:
$(document).ready(function() {
jQuery('.js-wpv-filter-trigger').select2();
});
Hi Michelle,
Thank you for contacting us and I'd be happy to assist.
The custom script that you've shared only executes the Select2 script, when the page loads or re-loads.
Since the view is set to update the results and pagination through AJAX (i.e. without reloading the page), you'll need to update that script, so that it is also executed when the pagination updates, when the search form updates and when the search results update, through AJAX:
( function( $ ) {
$( document ).on( 'ready js_event_wpv_pagination_completed js_event_wpv_parametric_search_form_updated js_event_wpv_parametric_search_results_updated', function( event, data ) {
$('.js-wpv-filter-trigger').select2();
});
})( jQuery );
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
My issue is resolved now. Thank you!