Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

fullcalendar javascript cannot update Calendar after settings Options Weekends to True

im using FullCalendar, and i want switch between Showing to not showing weekends and vice versa.

so it's OK when i try to from showings to not showing but when i try to go from a view without weekends to an an other view with weekend (set weekends option to True) my calendar stay without weekends.

<button id="prev" class="fc-prev-button fc-button fc-button-primary" type="button" >Précédent
</button>
                    
<p:remoteCommand name="myCommand"  actionListener="#{planningsMBean.loadPrevAction}" style="display: none;" update=":form:statutWeekendId" oncomplete="getStatutWeekend()"/>

in my function javascript

function getStatutWeekend(){
                console.log("get statut weekend -------");
            var element = document.getElementById("form:statutWeekendId");
            console.log("value of statut updated " + element.value);
            statutWeekendString = element.value;
            console.log(statutWeekendString==='OFF');
            if(statutWeekendString==='OFF'){
                
                calendar.setOption('weekends', false);
                calendar.prev();
            }
            console.log(statutWeekendString==='ON');
            if(statutWeekendString==='ON'){
                console.log("value of option before  " + calendar.getOption('weekends'));
                calendar.setOption('weekends', true);
                calendar.prev();
                console.log("value of option after  " + calendar.getOption('weekends'));
                
            }
                
                
            }

so when i get statut weekend to ON and i set Option weekend to true i log that this option is really true but my calendar still not showing weekend.

Thank you for your help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...