beforeShow event not firing on jQueryUI Datepicker

后端 未结 6 964
你的背包
你的背包 2020-12-05 18:00

No matter what I try, I\'m not able to get the beforeShow event to fire on my datepicker. Here\'s my code:

$(\'#calendar\').datepicker({
inline: true,
dateF         


        
6条回答
  •  一个人的身影
    2020-12-05 18:37

    It's a little bit tricky but use the setTimeout method to launch the function works well for me.

    $('#calendar').datepicker({
    inline: true,
    dateFormat: 'mm,dd,yy',
    beforeShow: function() { 
        setTimeout(function() {
            alert('before'); 
        }, 10);
    }
    });
    

提交回复
热议问题