簡體   English   中英

如何在另一個內顯示kendo模板?

[英]How to display a kendo template inside another?

我有一個用於添加/編輯的kendo彈出模板。 我需要在該模板的列表視圖中顯示帶有復選框的產品列表。我找到了此鏈接以創建復選框的列表視圖。 我如何在另一個模板中使用它。

****正在尋找類似的東西**** 在此輸入圖像描述

HTML

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

腳本

      $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
        },
...
.
.

提前致謝!

如果您發布一些示例代碼,顯示您正在嘗試執行的操作,則會有所幫助。 一般來說,模板中的模板是可能的,我之前在項目中完成了這個。 以下是Telerik的一個示例: http//www.telerik.com/forums/template-inside-template和另一個示例: http//www.telerik.com/forums/nested-templates

由內部列表框的kendo-angular-template實現。 請參閱此處的示例http://demos.telerik.com/kendo-ui/listview/angular

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM