0

I'm using bootstrap-datepicker to render a calendar control on the page.

When the datepicker control is created, I set the title tag based on some value, so day will have a title attribute set.

After the component renders I initialize bootstrap tooltips to create popovers. However, when the month is changed the tooltips stop functioning.

$('#datepicker').datepicker({
                    todayHighlight: true,
                    maxViewMode: 1,
                    beforeShowDay: function (date) {
                        return { classes: 'na', enabled: false, tooltip: msgNoSlotsAvailable };
                    },
                    toggleActive: true
                });
 $('.na').tooltip({container:'body'}); // Works, but only on current month
 $('#datepicker').datepicker().on('changeMonth', function (e) {
    $('.na').tooltip({container:'body'}); // Event fires, but the tooltips dont get added
 }

I think the issue is the event is firing before the DOM modifications are complete. I tried changeMonth:after on a whim but that did not work.

0

Browse other questions tagged or ask your own question.