You need to sign in to do that
Don't have an account?
DEBADYUTI SIL 30
Aura iteration is not loading css .
I have a page built with external css and scripts .I added css to load in parallel and js to load one after another using aura iteration as below:
When page load first time or if i open the browser console (Google Chrome) Then all components loads fine and css applies to it but if i refresh the app second time css breaks.Any help will be great.
<!-- Bootstrap --> <ltng:require styles="/resource/CorporateCommunicationResources/corp-comm-ui-prototype/lib/bootstrap/css/bootstrap.min.css"/> <ltng:require styles="/resource/CorporateCommunicationResources/corp-comm-ui-prototype/lib/bootstrap/css/bootstrap-theme.min.css"/> <!-- Main CSS --> <ltng:require styles="/resource/CorporateCommunicationResources/corp-comm-ui-prototype/css/font.css"/> <ltng:require styles="/resource/CorporateCommunicationResources/corp-comm-ui-prototype/css/jquery.ui.css"/> <ltng:require styles="/resource/CorporateCommunicationResources/corp-comm-ui-prototype/css/jqtransform.css"/> <ltng:require styles="/resource/CorporateCommunicationResources/corp-comm-ui-prototype/css/screen.css"/> <!-- scripts --> <ltng:require scripts='/resource/CorporateCommunicationResources/corp-comm-ui-prototype/js/jquery-2.1.4.min.js,/resource/CorporateCommunicationResources/corp-comm-ui-prototype/js/jquery.jqtransform.js,/resource/CorporateCommunicationResources/corp-comm-ui-prototype/js/jquery-ui.js,/resource/CorporateCommunicationResources/corp-comm-ui-prototype/js/hammer.min.js,/resource/CorporateCommunicationResources/corp-comm-ui-prototype/js/jquery.hammer.js,/resource/CorporateCommunicationResources/corp-comm-ui-prototype/lib/bootstrap/js/bootstrap.min.js,/resource/CorporateCommunicationResources/corp-comm-ui-prototype/js/jquery.tablesorter.min.js,/resource/LoadData,/resource/Script' afterScriptsLoaded ="{!c.jsLoaded}" />I have a component which uses aura:iteration multiple times as below:
<aura:iteration items="{!v.SomeListofList}" var="InsideList"> <aura:iteration items="{!InsideList}" var="data"> --- code ----- </aura:iteration> </aura:iteration
When page load first time or if i open the browser console (Google Chrome) Then all components loads fine and css applies to it but if i refresh the app second time css breaks.Any help will be great.
Why are you using multiple <ltng:require> tags in your component when you load all your CSS and JS in one <ltng:require> tag. The scripts attribute takes set of scripts in dependency order that will be loaded and styles attribute takes set of style sheets in dependency order that will be loaded.
Try changing your Component code to single <ltng:require> tag as below and see if it works for you.
Reference here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_ltng_require.htm (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_ltng_require.htm" target="_blank)
Thanks
- thatherahere