0

我在使用 Kendo Tabstrip 中的 Kendo Datepicker 时遇到问题。下面是我的代码。在运行时,我收到“错误:无效模板:”错误。关于如何让它发挥作用的任何想法?

<script id="EditDevelopmentPlanTemplate" type="text/kendo-tmpl">
@(Html.Kendo().TabStrip()
    .Name("EditDevelopmentPlanTabStrip")
    .SelectedIndex(0)
    .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))
    .Items(items =>
    {
        items.Add().Text("Quarterly Meeting Notes").Content(@<text>
            <div class="editor-label">
                @Html.LabelFor(m => m.EDP_Q1MeetingNotes, new { style = "width:470px" })
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.EDP_Q1MeetingNotes, new { style = "width: 470px" })
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.EDP_Q1MeetingDate)
            </div>
            <div class="editor-label">
                @Html.Kendo().DatePickerFor(m => m.EDP_Q1MeetingDate)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.EDP_Q2MeetingNotes, new { style = "width:470px" })
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.EDP_Q2MeetingNotes, new { style = "width: 470px" })
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.EDP_Q2MeetingDate)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.EDP_Q3MeetingNotes, new { style = "width:470px" })
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.EDP_Q3MeetingNotes, new { style = "width: 470px" })
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.EDP_Q3MeetingDate)
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.EDP_Q4MeetingNotes, new { style = "width:470px" })
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(m => m.EDP_Q4MeetingNotes, new { style = "width: 470px" })
            </div>
            <div class="editor-label">
                @Html.LabelFor(m => m.EDP_Q4MeetingDate)
            </div>
        </text>);
    }).ToClientTemplate())
</script>                    
4

1 回答 1

1

好的,因此对于可能遇到此问题的任何人,脚本末尾的 }).ToClientTemplate()) 并没有削减它。为了让 DateTimePicker 控件与模板一起工作,您必须在 DateTimePicker 声明的末尾添加 .ToClientTemplate() ,如下所示:

@Html.Kendo().DatePickerFor(m => m.Date).ToClientTemplate()
于 2014-12-02T21:30:18.523 回答