English 中文(简体)
以前显示的停尸厂 图片
原标题:Stop jquery-ui datepicker from showing in beforeShow

我愿这样做:

var showme = false;

$( #mydatepicker ).datepicker({
    beforeShow: function(input, inst) {
        if(!showme) {
            //stop showing
        }
    }
});

但是,工作似乎不可行,也不暗藏。 我愿做一些工作,如防止过失,但我认为,在这种情况下,这样做不会奏效。

最佳回答

从来文方来看,目前还看不到这一点。 你也许能够要求这样做。 如果你真的想要停止这种行动(尽管这可能是一个坏的想法),那么你就可能会在这一职能中犯错误。 虽然这将造成你一页的错误,可能不是一个选择。


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).

问题回答

我有同样的问题,发现你现在可以使用<代码>return不实;来防止日历上出现。

$( #mydatepicker ).datepicker({
    beforeShow: function(input, inst) {
        if(!showme) {
            return false;
        }
    }
});

I m 使用了1.7.2版本的j Query UI

最好简单地控制disable和enable方法参数的显示日期。

$( #mydatepicker ).datepicker( disable ); //Don t show datepicker 

$( #mydatepicker ).datepicker( enable ); //Show datepicker

It would seem to accomplish the same purpose that you are seeking.

防止开标的最好办法是在之前使用以下功能: 显示:

<代码>$(“#datepicker”);

这支部队后来关闭,甚至连显示。

我最接近的种子也有可能消失,但我并不真的想要使用一套装置。 这里的预示似乎只是一个 ha:

        var showme = false;

        $( #mydatepicker ).datepicker({
            beforeShow: function (input, inst) {

                if (!showme) {

                    setTimeout(function () { $(input).datepicker("hide"); }, 1);

                }
            }
        });

由于这批货物没有合并,我可以开一个 works子, works子运转良好。 让我知道你的想法:

beforeShow: function(){
    var start = $( #dtFrom ).val()
    if($.trim(start)!=  ){
        start = $( #dtFrom ).datepicker( getDate );
        $( #DateToDisplay ).datepicker( option ,  minDate , new Date(start.getTime()));
    }
},
    onClose: function() {
    var start = $( #dtFrom ).val()
    if($.trim(start)==  ){
        alert( Error! Please select a start date/time prior to setting the date to display. );
        $( #DateToDisplay ).val(  )
    }
}




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签