Support

Home Forums Events Calendar Add-on Calendar Ajax Not Loading in Tab

Calendar Ajax Not Loading in Tab

Posted: October 20, 2022 at 3:06 pm


pds-capcog

October 20, 2022 at 3:06 pm

I have the main [ESPRESSO_EVENTS] shortcode displaying the list of events in a tab structure and the calendar [ESPRESSO_CALENDAR] shortcode in a second tab which is hidden from the initial view/page load. The problem is when clicking to view the second calendar tab, only the calendar filters and header appear until I interact by clicking a button or filter (previous, today, next month buttons). Only then does the full monthly grid of events appear after the spinner loads in and the ajax-admin is called. How can I make the calendar load fully on page load while it is not visible within a hidden tab? Please advise.


Tony

  • Support Staff

October 24, 2022 at 7:47 am

Hi there,

Can you link me to the page this is on so I can take a look?

You can mark you reply private so only EE staff can view it if preferred.


presleydesign

October 24, 2022 at 8:10 am

This reply has been marked as private.


Tony

  • Support Staff

October 24, 2022 at 8:27 am

You can use a snippet like this to attach a click event to the calendar view and force the calendar to render, like this:

https://gist.github.com/Pebblo/a67cff006343dcfb3b326e33c69c2159#file-tw_ee_cal_rerender_on_click-php

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


pds-capcog

October 26, 2022 at 1:23 pm

Thanks. That kind of works. Although it requires a second click of the tab title to eventually render the calendar. Switching to the new tab alone does not fire the snippet.


Tony

  • Support Staff

October 27, 2022 at 3:18 am

Hmm, strange, that doesn’t happen when I use the console to add the code.

I can see the code in place on your site and can see it happening, but, if I copy that exact same code and run it within the Chrome dev tools console when I click on the Calendar View tab it loads the calendar straight away.

Will do some checking on this and get back to you with what I find.


pds-capcog

November 9, 2022 at 1:16 pm

Any update on this yet?


Tony

  • Support Staff

November 14, 2022 at 5:18 am

Hi there,

My apologies for the delayed reply.

I asked one of our developers about this who agreed the above should work although you could try adding it within a document ready call so I’ve updated the function to try that:

https://gist.github.com/Pebblo/a67cff006343dcfb3b326e33c69c2159#file-tw_ee_cal_rerender_on_click-php

It works within console for me, but so did the previous snippet so I can’t say for sure if it fixes it.


pds-capcog

November 14, 2022 at 7:56 am

Thanks. That extra code did not help. I’ve just split them into two separate pages for now instead of the tabs element.

The support post ‘Calendar Ajax Not Loading in Tab’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso