Sauter la navigation

[Résolu] Split: converting select dropdowns to use select2

This support ticket is created Il y a 5 années et 10 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Nigel Il y a 5 années et 10 mois.

Assisté par: Nigel.

Auteur
Publications
#1228532

Hi Nigel,
sorry if ask here a new question but it is related to this topic https://toolset.com/forums/topic/split-how-to-convert-a-normal-dropdown-to-a-select2-dropdown/#post-1207742

So, I have added the Select2 style to all Select Boxes in this page lien caché, but when I select a "Regione" option the al Select Boxes style change to normal Select style...

In the search form, I have added a slide to select the ages range, when I select a "Regione" option the slide crash...

Also, the slide is generated by jQuery, and in smartphone and tablet I cannot select the age range, the slider input doesn't work with the finger... And if I do a search by the age range, and after I click to reset button, the range values aren't reset...

Can you help me on this?

About the favorites, I'm trying these days to do the tests.

#1228670

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Screenshot 2019-04-10 at 15.06.01.png

Hi Francesco

Your View has an option to update results with ajax whenever any of the filters are changed, and that means that the filters themselves get replaced in the DOM, not just the View results.

So any changes you made to those DOM elements (e.g. initialising select2 library on select elements) are lost.

You need to add those changes back.

Views provides several custom JS events you can hook into in such circumstances, e.g. when filters are updated via ajax, or ajax pagination completes etc.

You can insert placeholder code to use them in the custom JS section of the Search and Pagination editor, there is a button "Front-end events", and the screenshot shows the event you would use.