KendoUI DateTimePicker undefined on document.ready

前端 未结 3 793
故里飘歌
故里飘歌 2021-01-14 18:41

I have a Kendo DateTimePicker control in an mvc (asp.net) partial view that I am trying to access from document.ready():

@(Html.Kendo().DateTimePickerFor(vvm         


        
3条回答
  •  不思量自难忘°
    2021-01-14 19:06

    What I ended up doing is initializing the datetimepicker from pure javascript and ditched the razor version:

    function TestDTP() {
        $("#dtpVisitStart").kendoDateTimePicker({
            format: "MM/dd/yyyy HH:mm tt",
            timeFormat: "HH:mm", 
            change: dtpVisitStart_Change, 
            value: "@(startTime)"
        });
        var dtp = $("#dtpVisitStart").getKendoDateTimePicker();
        debugger;
    }
    

提交回复
热议问题