Skip to content

Instantly share code, notes, and snippets.

@alexiglesias93
Last active February 28, 2022 12:41
Show Gist options
  • Save alexiglesias93/c6b9348c3e7e3450e66b6e3d00d77edf to your computer and use it in GitHub Desktop.
Save alexiglesias93/c6b9348c3e7e3450e66b6e3d00d77edf to your computer and use it in GitHub Desktop.
`cmsfilter` API
/**
* Listening for `renderitems` events on a `cmsfilter` setup.
*/
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([
'cmsfilter',
(filterInstances) => {
console.log('cmsfilter Successfully loaded!');
console.log(filterInstances);
const [filterInstance] = filterInstances;
console.log(filterInstance);
console.log(filterInstance.filtersData);
// The `renderitems` event runs whenever the list renders items after filtering.
filterInstance.listInstance.on('renderitems', (renderedItems) => {
console.log(renderedItems);
});
},
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment