Skip Navigation

[Resolved] Bootstrap expandable section and ajax load

This support ticket is created 7 years, 3 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.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 7 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#561389

Hi,

I've created a custom search along with an "view map" expandable section (which is basically a bootstrap expandable section). The "view map" button opens to show the map of all the pins in the search. This works great, however when I use the filters and the results reload via AJAX, the map disappears and will no longer expand. I'd like the map to stay open and just filter. Is this possible? You can see my example here: hidden link

Thanks.

#561486

The Problem is the AJAX filter.
Often it's required to re-initiate the JS function so the things work again after an AJAX update.

To do so, you can open the JS Section in the Custom Filter Section of your View
There you will see a Frontend Events Button.
Click it, you will see several options that you can use to re-hook your JS Functions.

I think this must work with the Map only, if you do not use an expandable section.
Can you confirm this?

That means, your expandable section needs to be re-instantiated.

In this case, you need to find the function you need to instantiate tha expandable area, and hook it in the JS section as above shown.

#563385

Ok, thanks. I found those options and was able to make it work...kinda, but there becomes the issue of detecting whether it's open already or not as well. Anyways, I was looking around and I'm wondering if I'm going about this the wrong way. I'd like to do something similar to hotels.com where you can toggle the map view vs. the list view. Is there a simple way to do this where you can flip between the two views but persist the filters selected?

#563491

Most likely when you use AJAX updated Search Filters you will have to re-initiate your expandable sections.
The filters do persist, the problem is that your expandable section will need to re-fire so to work properly.

This happens as well when you reload the whole page - that is why it works with this method.
So you need to re-fire the same function on AJAX, using the Filter we offer.

If you need more help with this Custom Code, I can try to point you to the right solution if I see it online, or it could be possible that you need custom programming work which is beyond the scope of our support.

At this point I would suggest you consider contacting one of our certified partners from this link:
https://toolset.com/consultant/

You will get the custom assistance you need to get on with your project.

I activated a private reply where you can share with me the exact location of the map (both front and backend) and I can have a look.