Stop jquery-ui datepicker from showing in beforeShow

后端 未结 6 2079
不知归路
不知归路 2021-01-13 13:10

I wish to do something like this:

var showme = false;

$(\'#mydatepicker\').datepicker({
    beforeShow: function(input, inst) {
        if(!showme) {
               


        
6条回答
  •  死守一世寂寞
    2021-01-13 14:04

    Looking through the source, it doesn't look like that is possible currently. You might be able to request that as a feature. If you really want to make it stop (though this is probably a bad idea) you could throw an error in that function. Though this will cause errors to show up for your page and probably is not an option.


    Note: I submitted a patch for this and it's now in the released jQuery UI (at least v1.9 and later), although the documentation doesn't mention it. return false in beforeShow will prevent the datepicker from appearing (now).

提交回复
热议问题