Skip Navigation

[Résolu] Enable Ajax filters after calling view via Ajax

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

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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 3 réponses, a 2 voix.

Dernière mise à jour par Adrian Il y a 6 années et 9 mois.

Assisté par: Nigel.

Auteur
Publications
#619860

I am loading views via ajax using this: https://toolset.com/forums/topic/ajax-load-view/
The problem I am encountering is that the view filters do not work using this method.

Problem is that any document ready handlers would have to be re-assigned upon an ajax change.

So basically when I am clicking a link it loads the view, or what is between <!-- wpv-loop-start --> and <!-- wpv-loop-end -->
and same for the filter, within my #target div.

Problem is that I think the form's refresh function is outside somewhere on the code. Do you know how I can include that within the wpv-loop-end so that the ajax form filters can work, and refresh the contents within the #target div, IE not refreshing the whole page?

#619865

Ok, so I can see the filter change and narrow down, I think it just needs to know which div to target. in order to refresh the data.

#620021

Nigel
Supporter

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

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

Hi Adrian

I read your post and the post that you linked to.

In that post the user has one View which generates links to load another View in place via ajax.

I'm not sure from your question if you have a similar set up, one main View producing links to load another View via ajax.

So when you say you have problems with the filters not working, document ready handlers etc., are you talking about code that is on the main View or code that is on the View which is loaded by ajax?

Can you be a bit more specific describing your example...

#620318

Hi Nigel,

I was able to find the issue.
I believe it is a bug, but I may be wrong.

Happens on both normal pages where I just put the view on the page via a shortcode, and if I load them through ajax.

Filters work with the following configuration:
[wpv-filter-meta-html]
[wpv-layout-meta-html]

Filters are not working with the following configuration:
[wpv-layout-meta-html]
[wpv-filter-meta-html]