Calendar View Drop-down not changing when chaning view via javascript

edited February 14, 2017 in Questions
I have some javascript code that that can change the calendar view programatically as follows:

CalendarObject = skuid.$('#CenterCalendar').data('object');
CalendarObject.currentView = 'month';
CalendarObject.refresh();

the refresh() redraws the calendar in month view when the code above runs.

I can do the same to change to week view:
CalendarObject = skuid.$('#CenterCalendar').data('object');
CalendarObject.currentView = 'week';
CalendarObject.refresh();

The problem is that for me the drop-down in the UI does not change to reflect which view its currently displaying.  It stays in the default one even though I am chaning it programtically.

How do I keep the drop-down in sync with the rest of the UI in the calendar.

Thanks

Comments

  • Matt SonesMatt Sones 💎💎💎
    edited February 10, 2017
    Leo,

    Not sure if this will work, but you could try to re-render the whole component, instead of just refreshing the calendar:
    skuid.$C('CenterCalendar').render();
  • edited February 14, 2017
    Thanks Matt.  That works.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!