Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a kendo template inside another?

I've a kendo popup template for add/edit. I need to display a list of product with a check-box inside a list-view in that template.I found this link to create a list-view of check boxes. How do i use this inside another template.

****Looking for something like this**** enter image description here

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>

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

Thanks in advance!

like image 766
CGN007 Avatar asked Oct 30 '22 10:10

CGN007


1 Answers

If you post some sample code showing what you're trying to do it would help. In general though, a template within a template is possible and I've done this in projects before. Here's an example directly from Telerik: http://www.telerik.com/forums/template-inside-template and another example: http://www.telerik.com/forums/nested-templates

like image 133
Ageonix Avatar answered Nov 10 '22 00:11

Ageonix