You need to sign in to do that
Don't have an account?
DEBADYUTI SIL 39
Scripts seems not loading while creating component dynamically
Hi,
I am creating component dynamicaly usning code as below :
Now i have couple of resources placed in app as below :
When the component gets created in dom it's not able to use the script.It seems while the components gets created it can not use the scripts which are already loaded as part of app load.Any help will be great .
I am creating component dynamicaly usning code as below :
$A.createComponent( "c:M",yComponent", {}, function(newCmp){ if (component.isValid()) { var content = component.find("content"); content.set("v.body", newCmp); } } );
Now i have couple of resources placed in app as below :
<!-- Bootstrap --> <ltng:require styles="/resource/resource/lib/bootstrap/css/bootstrap.min.css"/> <!-- Main CSS --> <ltng:require styles="/resource/resource/css/font.css"/> <ltng:require styles="/resource/resource/css/jquery.ui.css"/> <ltng:require styles="/resource/resource/css/jqtransform.css"/> <ltng:require styles="/resource/resource/css/screen.css"/> <!-- jQuery library --> <ltng:require scripts="/resource/resource/js/jquery-2.1.4.min.js,/resource/resource/js/jquery-ui.js,/resource/resource/js/hammer.min.js,/resource/resource/js/jquery.tablesorter.min.js,/resource/resource/js/jquery.jqtransform.js,/resource/resource/lib/bootstrap/js/bootstrap.min.js,/resource/scriptjs" />
When the component gets created in dom it's not able to use the script.It seems while the components gets created it can not use the scripts which are already loaded as part of app load.Any help will be great .
Michał Zadrużyński 2
load all js scripts in one line and define action to be executed after scripts are loaded (not on init):