2014-11-24 81 views
0

我遇到了Kendo Tabstrip內部的Kendo Datepicker問題。以下是我的代碼。在運行時,我收到「錯誤:無效的模板:」錯誤。任何想法如何去實現這個工作?Kendo Grid內部的Kendo日期選擇器Tabstrip - 無效的模板

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

回答

0

好了,這樣的人在那裏,可能會遇到這樣的})。ToClientTemplate())在腳本的結尾不剪。爲了使DateTimePicker控件與模板一起工作,必須在DateTimePicker聲明的末尾添加.ToClientTemplate(),如下所示:

@Html.Kendo().DatePickerFor(m => m.Date).ToClientTemplate()