Hi, Is there a way to stop the page from displayin...
# suitecommerce
c
Hi, Is there a way to stop the page from displaying before a promise is returned in my extension? I have an extension that is adding a child view to the header and the full page displays then a few seconds later the extension data shows because it is fetching data from NetSuite
m
where are you doing the fetch? have you tried using the function beforeShowContent?
c
@cdawson I solve this by calling
.fetch
in my
initialize
function, then I create a reference to the view
var view = this;
and after the promise finishes, and I have added the new data to the views model, in
.done(...
I call
view.render();
which updates the view with my new data.
c
Hi Chris, I was doing it this way but this is causing the issue of the page rendering and then the data displaying a few seconds later. Hi Martin, Any time I have tried that the function doesnt trigger i think its because im adding it as a child view of the layout component
c
@cdawson Are you wanting to stop rendering for the entire page until the fetch is complete? Am I understanding this correctly?
@cdawson Not sure if you're seen this: https://developers.suitecommerce.com/bootstrap-important-data-at-application-load.html It might not work if it's PDP related...
c
Hi Chris, Thats great thanks thats what I have been looking for