Executing code after CMS Load finishes loading all items

I would like to have some code execute after CMS Load completes loading all items. How would I do this using Javascript?

Hey @agarwala! You can use the CMS Load callback to run code after the Attribute load and each time the elements are rendered on the page.

Here is the code

  window.fsAttributes = window.fsAttributes || [];
    (listInstances) => {
      console.log('cmsload Successfully loaded!');

      const [listInstance] = listInstances;

      //Code to run once after the Attribute loads goes here

      listInstance.on('renderitems', (renderedItems) => {
        //Code to run each time items are rendered goes here

This worked perfectly @Support-Luis. Thank you!

You can see it in action here:

1 Like

Awesome! :muscle: