我必须在 Tabstrip 的每个选项卡单击上动态加载不同的 KENDO 模板。所有选项卡的数据源都是相同的。我正在尝试按以下方式进行操作,但它不起作用。请告知。(剑道 TabStrip 和剑道模板)
<div class="tabs-details-wrapper" id="Tab1">
<ul>
<li class="k-state-active" >Identification</li>
<li>Planning</li>
<li>Implementation</li>
<li>Review</li>
<li>Management Response</li>
</ul>
<div>
<div class="row">
<div class="col-xs-12 col-md-5">
<div class="">
<div class="form-horizontal" ></div>
</div>
</div>
</div>
</div>
</div>
<script id="details-templateTab1" type="text/x-kendo-template">
<div class="form-group">
<label class="col-xs-12 col-md-4 control-label">Year of Completion</label>
<div class="col-xs-12 col-md-8">
<span class="control-readonly"></span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-md-4 control-label">Title</label>
<div class="col-xs-12 col-md-8">
<span class="control-readonly"></span>
</div>
</div>
</script>
<script id="details-templateTab2" type="text/x-kendo-template">
<div class="form-group">
<label class="col-xs-12 col-md-4 control-label">Hello1</label>
<div class="col-xs-12 col-md-8">
<span class="control-readonly">
</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-md-4 control-label">Title1</label>
<div class="col-xs-12 col-md-8">
<span class="control-readonly">
</span>
</div>
</div>
</script>
$(".tabs-details-wrapper").kendoTabStrip({
select: function (e) {
//var data = this.dataSource.at($(e.item).index());
var templateSelector = ""
// alert(e);
if (e.item.innerText == "Identification") templateSelector = kendo.template($("#details-templateTab1").html())
else templateSelector = kendo.template($("#details-templateTab2").html()) ;
// alert(e.contentElement);
//templateSelector = kendo.template($("#details-templateTab1").html());
$(e.contentElement).html(templateSelector);
// kendo.bind(e.contentElement, data);
// $(e.contentElement).html(template(this.dataSource.at($(e.item.innerText).index())))
},
// template: $("#details-templateTab1"),
animation: false
//dataSource: ds
// dataSource: ds,
});