Javascript 如何在另一个剑道模板中显示剑道模板?
我有一个剑道弹出模板用于添加/编辑。 我需要在该模板的列表视图中显示一个带有复选框的产品列表。我发现这是为了创建一个复选框列表视图。我如何在另一个模板中使用它 ****在找这样的东西吗**** HtmlJavascript 如何在另一个剑道模板中显示剑道模板?,javascript,angularjs,html,kendo-ui,kendo-grid,Javascript,Angularjs,Html,Kendo Ui,Kendo Grid,我有一个剑道弹出模板用于添加/编辑。 我需要在该模板的列表视图中显示一个带有复选框的产品列表。我发现这是为了创建一个复选框列表视图。我如何在另一个模板中使用它 ****在找这样的东西吗**** Html <script type="text/x-kendo-tmpl" id="myTemplate"> <div class="item click" value="#=ProductID#" data-bind="checked: isSelected"&g
<script type="text/x-kendo-tmpl" id="myTemplate">
<div class="item click" value="#=ProductID#" data-bind="checked: isSelected">
<input type="checkbox" class="click" />
<span class="checkbox">#:ProductName#</span>
</div>
</script>
<!-- Kendo popup editor template -->
<script id="popup_editor" type="text/x-kendo-template">
<div style="width:700px">
<div style=" margin-left:100px">
<label for="Product">Products </label>
<div id="listView" class="k-listview" style="width:150px;height:250px;overflow-y:scroll;margin-top:10px">
</div>
</div>
</div>
</script>
提前谢谢 如果您发布一些示例代码,说明您正在尝试做什么,这将有所帮助。不过,一般来说,模板中的模板是可能的,我以前在项目中也做过。 这里有一个直接来自Telerik的示例: 还有一个例子: 由剑道角度模板为内部列表框实现。请看这里的例子
$scope.productddlDataSource = new kendo.data.DataSource({
type: "json",
transport: {
read: "api/product"
}
});
$("#listView").kendoListView({
dataSource: $scope.productddlDataSource,
template: kendo.template($("#myTemplate").html())
});
//KENDO UI POP_UP
$scope.gridOptions = {
dataSource: $scope.data,
sortable: true,
filterable: true,
scrollable: false,
toolbar: [{ name: "create", text: "ADD Product" }],
editable: {
mode: "popup",
template: kendo.template($("#popup_editor").html()),
confirmation: true
},
...
.
.