Skip Navigation

[Resolved] Problem with AJAX pagination with multiple Views in one page

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Waqar 7 months ago.

Assisted by: Waqar.

Author
Posts
#2693437

Hi, I have a page with multiple Views in one page, and each have pagination using AJAX, I am using a the frontend events on each Views to scroll to their respective top using this code as example in one of my Views:

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
if( data.view_unique_id === 331){
$('html, body').animate({
scrollTop: $(".pub-anchor").offset().top
}, "fast");
}
});

But it doesn't work, do you know what went wrong with that?

Thanks

#2693540

Hi,

Thank you for contacting us and I'd be happy to assist.

To troubleshoot this, I'll need to see how these views are set up in the admin area. Can you please share temporary admin login details, along with the exact steps to see the issue?

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2693865

Thank you for sharing the access details.

The value of the 'data.view_unique_id' is not equal to the view's ID, but it does start with it.

I've updated the custom script accordingly and it is working, now:


jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
  if (data.view_unique_id.match("^331-")) {
    jQuery('html, body').animate({ scrollTop: (jQuery(".pub-anchor").offset().top) - 250 }, 'slow');
  }
});

#2694021

Hi Waqar, thank you my Issue is resolved!