[SOLVED] Widget Packages Load

Answered
0
0

Hi everyone,

I’m encountering a small problem with the Widget.
I’m using more than 4 Packages and there are all needed to be downloaded from the internet, on the Window Load event i used Widget.Call(“function”), but at the first run the Widget hasn’t downloaded all the packages and tried to do che JavaScript function.

I tried implementing some coding like:

$(window).bind('load', function(){ });
window.onload = function () { alert("It's loaded!") }
document.addEventListener("DOMContentLoaded", function(event){});
$( document ).ready(function() {})

but the Widget seems to ignore it and don’t execute the code inside.

It will be nice to have an Event on the Packages loaded or something like that.

Or maybe there is a better way to do that?
Regards,
Alex.

  • You must to post comments
Best Answer
1
0

Hi Alexandru,

 

You should be able to handle the completion of the packages load through the “init” event of the widget.  With this event (in InitScript property) you can call something like:

this.fireWidgetEvent(“ready”);

 

You might find this documentation useful: https://wisej.com/docs/2.0/html/P_Wisej_Web_Widget_InitScript.htm

 

I hope this helps, please let me know if you need any clarification or have any mores questions!

 

Best,

Levie

  • Alexandru Tutuianu Miu
    Hi Levie, First of all thank you for the response. I used the code as you suggested and it worked fine. Regards, Alex
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.