Skip Navigation

[Resolved] Enable Ajax filters after calling view via Ajax

This support ticket is created 6 years, 8 months ago. 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.

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)

This topic contains 3 replies, has 2 voices.

Last updated by Adrian 6 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#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

Languages: English (English ) Spanish (Español )

Timezone: 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]