Search code examples
orocrmorocommerce

How can I detect that all page components were loaded in Oro application?


I have a task to get some data from API asynchronously - page loads, components initialize and fill data object with mediator, and after all components were initialized - send request, get it and do some other logic. So, the question is, how can I detect that all page components have been initialized?


Solution

  • Mediator triggers page:afterChange event once all standard components are initialized and ready to use. So you can listen to that event.

    https://doc.oroinc.com/frontend/javascript/#page-controller