Search.../

onReady( )

Adds an event handler that runs when the dataset is ready.

Description

The onReady() function allows you to optionally perform actions right after the dataset has loaded its data from the collection and updated all connected page elements with their corresponding values.

Note: The dataset onReady event only fires after the page onReady event fires.

Syntax

function onReady(handler: ReadyHandler): void
handler: function ReadyHandler(): void

onReady Parameters

NAME
TYPE
DESCRIPTION
handler

ReadyHandler

The ready handler.

Returns

This function does not return anything.

Return Type:

void

ReadyHandler Parameters

This function does not take any parameters.

Returns

This function does not return anything.

Return Type:

void
Mixed in from:wix-dataset.Dataset

Was this helpful?

Register a callback to run after the dataset is ready

Code Example

Copy Code
1$w("#myDataset").onReady( () => {
2 console.log("The dataset is ready");
3} );