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

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

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();

Thanks Matt.  That works.