You need to sign in to do that
Don't have an account?
Dhaker Hassine
calendar div doesn't show in aura:renderIf tag
Hello everyone,
In wanted to refresh a div containing a full calendar. I put this div into aura:renderIf tag, and in the JS controller I make a window.setTimeout method.
The div exists in page inspection, but doesn't reappear in the body of the page.
Anyone knows this problem?
Or any other suggestion to refresh this div?
Here are codes:
1. Calend.cmp
<aura:renderIf isTrue="{!v.truthy}"> <ltng:require scripts="{!join(',', $Resource.fullcalendar + '/fullcalendar/jquery.min.js', $Resource.fullcalendar + '/fullcalendar/jquery-ui.min.js', $Resource.fullcalendar + '/fullcalendar/moment.min.js', $Resource.fullcalendar + '/fullcalendar/fullcalendar.min.js')}" styles="{!$Resource.fullcalendar + '/fullcalendar/fullcalendar.min.css'}" afterScriptsLoaded="{!c.scriptsLoaded}" /> <div>Hi from test div</div> <div id='calendar'></div> </aura:renderIf>
2.CalendController.js
component.set("v.truthy",false); window.setTimeout( $A.getCallback(function() { component.set("v.truthy",true); // setTimeout($('#calendar').fullCalendar(), 3000); console.log("I'm in setTimeOut function"); console.log(component.get('v.truthy')); }) ,3000);
All Answers
you may use
<div display="{!if(v.truthy,'','none')}">
to replace <aura::renfderIf>
by using <div>, the section is rendered by hiden, the script should alway be running.
Hello David!
No it doesn't work! :(