Has anyone got a modal progress indicator to work on a transaction form on the client side. I've tried jQuery etc but it seems that iterating over line items in SuiteScript causes some sort of UI blocking and the dialog doesn't show until after the execution is complete.
c
creece
06/05/2019, 8:30 PM
Since its client side, you can use the promise API and the N/ui/message module to show/hide a banner message on the record
j
jkabot
06/05/2019, 8:44 PM
@JohnnyC initiate the loading / progress indicator and then start doing the work after a 1ms timeout to give the indicator enough time to render before NetSuite APIs start blocking main thread
j
JohnnyC
06/05/2019, 8:45 PM
Tried that which does seem to work but for me I need to give it two seconds
JohnnyC
06/05/2019, 8:45 PM
Thanks
j
jkabot
06/05/2019, 8:46 PM
2s seems pretty long, 1ms works for me, but if it works it works I guess
jkabot
06/05/2019, 8:46 PM
I'm using sweetalert for loading indicator though so maybe that's the difference
j
JohnnyC
06/05/2019, 8:49 PM
Yea I was just using a jQuery dialog perhaps not optimized, but now I just tried it again at 1ms and it worked.