I am currently faced with a challenge: loading an HTML file that contains dijit.Form
into a ContentPane
. The catch is, I am unsure of which dijits will be required until the HTML is actually loaded. However, I know that the loaded HTML will contain necessary require
statements to load them.
To tackle this issue, I am utilizing dojox.layout.ContentPane
in order to execute the script from the loaded HTML. But here's the problem - when I set parseOnLoad
to true
, the parsing occurs before the script execution, meaning the dijits are not yet available during the initial content load. Additionally, even when using the onDownloadEnd
callback, the dijits specified in the require
statements are still not loaded at that point.
At this moment, the only solution I can think of is to utilize setTimeout
to delay parsing until after the scripts have been executed. However, I am hesitant about this approach as it may not always be reliable and could potentially make the application less responsive.
So my question is, how can I ensure that the parsing happens right after the require
statement from the loaded HTML has been successfully run?