Available JavaScript lifecycle events

Below is a list of the JavaScript events you can hook into on the lifecycle of Filter Query Block Pro. Each section shows the event name, a short description, and a ready-to-copy code example.

filterQueryBlock:beforeInit

Fires just before the block is initialized.

// Listen for the beforeInit event
document.addEventListener('filterQueryBlock:beforeInit', (event) => {
  console.info('Received filterQueryBlock:beforeInit', event.detail);
}, true);

filterQueryBlock:afterInit

Fires just before the block is initialized.

// Listen for the afterInit event
document.addEventListener('filterQueryBlock:afterInit', (event) => {
  console.info('Received filterQueryBlock:afterInit', event.detail);
}, true);

filterQueryBlock:initError

Fires if an error occurs during initialization.

// Listen for the initError event
document.addEventListener('filterQueryBlock:initError', (event) => {
  console.info('Received filterQueryBlock:initError', event.detail);
}, true);

filterQueryBlock:beforeRender

Fires just before the block renders its UI.

// Listen for the beforeRender event
document.addEventListener('filterQueryBlock:beforeRender', (event) => {
  console.info('Received filterQueryBlock:beforeRender', event.detail);
}, true);

filterQueryBlock:afterRender

Fires once rendering has finished.

// Listen for the afterRender event
document.addEventListener('filterQueryBlock:afterRender', (event) => {
  console.info('Received filterQueryBlock:afterRender', event.detail);
}, true);

filterQueryBlock:stateChange

Fires whenever the block’s internal state changes.

// Listen for the stateChange event
document.addEventListener('filterQueryBlock:stateChange', (event) => {
  console.info('Received filterQueryBlock:stateChange', event.detail);
}, true);

Thank you for exploring the available events. If you have any questions or need further examples, feel free to reach out—our team is always here to help you integrate these lifecycle hooks smoothly into your project.

Supercharge your feeds!

Become part of a growing community of satisfied users. Experience seamless customization, top-notch support, and regular updates. Try it out with our 14-day money-back guarantee.