1

Is there anyway to know if the view is ready/finished rendering? Since oraclejet uses Knockout for data-binding, is this on Knockout'part?

My usecase would be:

  • Load the website. Router point to "A" view and that view uses "A.js" via "ojModule" namepsace as model
  • I would like to run some codes after "A" view has been fully rendered.
4

2 回答 2

3

您可以为此使用busycontext,如下面的函数所示。您可以在BusyContext中参考更多信息

function refreshBusyContext() {
  self.pageBusyContext = oj.Context.getPageContext().getBusyContext();
  self.pageBusyContext.whenReady().then(function () {
    console.log('page load is done');
  });
}

我认为您还可以使用如下的生命周期方法,例如handleBindingsApplied ()

self.handleBindingsApplied = function(info) {
 // Executes after all the bindings applied and all jet components are ready in view
};
于 2017-12-08T06:12:23.447 回答
1

您可以使用 BusyContext,作为另一种选择,您可以考虑使用模板绑定、链接和使用 afterRender 回调。

于 2020-07-20T14:26:28.657 回答