Skip Navigation

[Résolu] Trigger the pagination click

This support ticket is created Il y a 1 an et 8 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 5 réponses, has 2 voix.

Last updated by Shane Il y a 1 an et 8 mois.

Assisted by: Shane.

Auteur
Publications
#2437569
Screenshot 2022-08-14 at 5.23.36 PM.png

Dear Sir/Madam,

I have a View with default Toolset pagination, there is some custom javascript to the View, I want to execute my custom script before continue the event to the pagination. How can I do that?

Refer to the screenshot, I want to stop all audio play before I jump into another pagination.

Best regards,

Kelvin.

#2438161

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

Thank you for getting in touch.

This can be done by adding your javascript to the following callback function for the ajax pagination.

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.effect (string) The View AJAX pagination effect
	* data.speed (integer) The View AJAX pagination speed in miliseconds
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
	

});

Once you've added your function within this callback it should trigger again after the again pagination.

Thanks,
Shane

#2441365

Dear Shane,

What should I return after completion of my custom script?

Best regards,

Kelvin.

#2443479

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

I'm not sure what you mean.

The script i've provided is the callback for the pagination. So if you add your existing javascript inside the provided callback function then your script will run again after the pagination has been completed.

Thanks,
Shane

#2446027

Dear Shane,

Is there a list of callbacks for reference so that I don't need to ask for support?

Best regards,

Kelvin

#2447103

Shane
Supporter

Languages: Anglais (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

We don't have a list of the callback functions but we do have some documentation on how to see all of them in views.
https://toolset.com/documentation/programmer-reference/adding-custom-javascript-code-to-views-that-use-ajax/

Please let me know if this helps.
Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.