beforeShow event not firing on jQueryUI Datepicker

后端 未结 6 961
你的背包
你的背包 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:30

    I found a fix for that. You must add 3 lines of code in jquery.ui.datepicker.js (the full version)

    Near line #274, find thisthis._updateAlternate(inst);

    Right after this line, put the following :

    var beforeShow = $.datepicker._get(inst, 'beforeShow');
    if(beforeShow)
       beforeShow.apply();
    

    Version from jqueryui.com does not have beforeShow enabled for inline datepicker. With this code, beforeShow is enabled.

提交回复
热议问题