Hi,
We've been researching to create custom control add ins. However, during research, we found something that limit many the control add ins features and visibility.
First is the iframe and html body that hosts the control add in is by default hiding the scroll both horizontally and vertically. Please add a config in the control add in to specify whether the scroll will be shown or not.
For iframe, the config should translate "scrolling" attribute to "yes" or "no" AND for the body, the config should translate "overflow" attribute to "hidden" or "scroll", they should be based on the config.
The solution is: maybe inside the control add ins can be added something like this
controladdin DemoControl
{
AllowScroll = true;
}
Second, the default placement of script inside control add ins is always before the body. Due to how some Javascript library works, sometime it's necessary to put the script tag AFTER the body because some of those library manipulate the document.body. document.body will be null if the scripts are runs before the body itself.
https://www.helpfulbean.com/article/javascript_document_body_null
The solution is: maybe inside the control add ins, script can be configured to a something like this
controladdin DemoControl
{
Scripts = { placement: 'before', 'script1.js' }
, { placement: 'after', 'script2.js' }
}
Hopefully those two features can be implemented someday.
Thank you for the attention.
Comments
For the second suggestion, I found standard JS had already similar approach, it's called deferhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement/deferso perhaps the prototype code for AL could be:controladdin DemoControl{ Scripts = { defer: false, 'script1.js' } , { defer: true, 'script2.js' }}
Category: Development
Business Central Team (administrator)
Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team