如何让我的Datepicker工作?

时间:2017-09-17 19:30:55

标签: javascript c# jquery asp.net datepicker

我的日期拣货员不起作用。 我搜索了许多类似于我的问题。 但我仍然无法找到解决方案。 我只粘贴了我认为存在问题的代码。 这是我在aspx中的代码: 它在剧本中。

videoURL = [URL(fileURLWithPath: Bundle.main.path(forResource: "LowDribble", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallBBw:Pound", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallBBw:PickUp", ofType: "mp4")!), URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallBB", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallInOut", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallOverDribble", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallThruHoop", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallThruLeg", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallThruLegLo", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallWiper", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallIOBBCrossCombo", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallIOBetweenLegsCombo", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallComboFreestyle", ofType: "mp4")!)]

videoUrl = [URL(fileURLWithPath: Bundle.main.path(forResource: "TwoBallBBw:Pound", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "TwoBallBtwLegwPound", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "TwoBallCrosswPound", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "TwoBallHiLo", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "OneBallThruHoop", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "TwoBallIOw:Wiper", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "TwoBallJuggle", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "TwoBallInOut", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "TwoBallWiper", ofType: "mp4")!),URL(fileURLWithPath: Bundle.main.path(forResource: "TwpBallOverDribble", ofType: "mp4")!)]

中有所有内容
$(function () {
        init();
    });

     function init() {
        if (typeof $("#ContentPlaceHolder1_hidDepartDate").val() !== "undefined") {
            var _dateStr = $("#ContentPlaceHolder1_hidDepartDate").val().substring(0, $("#ContentPlaceHolder1_hidDepartDate").val().length - 1);
            var _dateStrArray = _dateStr.split(",");
        }

        $("#ContentPlaceHolder1_datepicker").datepicker({
            beforeShowDay: function (date) {


                var string = jQuery.datepicker.formatDate('yy-mm-dd', date);

                return [_dateStrArray.indexOf(string) >= 0];
            },
            onSelect: function (selected, evnt) {
                ChangeHiddenRadioButtonSelected(CTypeToDateString(selected));
            },
            inline: true
        });

    }

    function CTypeToDateString(selected) {
        var tempTime = selected.split("/");
        var year = tempTime[2];
        var month = tempTime[0];
        var day = tempTime[1];
        var yyyymmdd = year + "/" + month + "/" + day;
        return yyyymmdd;
    }

    function ChangeHiddenRadioButtonSelected(SelectDate) {

        var _dateCount = $("#ContentPlaceHolder1_hidDepartCount").val();
         //alert(_dateCount);
        var ServerDate = "";
        for (var i = 0; i < parseInt(_dateCount); i++) {

            ServerDate = $('label[for="ContentPlaceHolder1_rblDepartDate_' + i + '"]').html().substring(0, 10);

            if (ServerDate == SelectDate) {
                var radioItem = $('input[id="ContentPlaceHolder1_rblDepartDate_' + i + '"]');
                if (radioItem) {
                    if (typeof $('input[id="ContentPlaceHolder1_rblDepartDate_' + i + '"]').attr("onclick") !== "undefined") {
                        if ($('input[id="ContentPlaceHolder1_rblDepartDate_' + i + '"]').attr("onclick").indexOf("no1") >= 0) {
                            alert('no2');
                            return false;
                        } else {
                            $('input[id="ContentPlaceHolder1_rblDepartDate_' + i + '"]').prop("checked", true);
                        }
                    } else {
                        $('input[id="ContentPlaceHolder1_rblDepartDate_' + i + '"]').prop("checked", true);
                    }
                } else {
                    return false;
                }
            }
        }
    }

    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_pageLoaded(init);

datepicker的代码是

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

来自cs的传递:

 <div runat="server" id="datepicker"></div>

我认为问题可能出在这段代码中。 请帮帮我。

0 个答案:

没有答案