Template returns name of template?

2 posts, 0 answers
  1. Cecil
    Cecil avatar
    15 posts
    Member since:
    Dec 2011

    Posted 10 Nov 2015 Link to this post

    I have a template that returns the name of the template when loaded.

    <div><ul id="inspectionlist"></ul></div>

     

    <script id="attachment-template" type="text/x-kendo-template">
        <table class="instable">
            <tr class="insrow">
                <td class="inscell1"><label>#: RiskAssessment #</label></td>
                <td class="inscell2"><label>#: AreaDescription #</label></td>
                <td class="inscell3"># if (HasAttachments) { # <a data-role="button" data-click="onClick">VIEW</a> # } #</td>           
            </tr>       
        </table>
    </script>

     

    var ourList = e.view.content.find("#inspectionlist");
     
            ourList.kendoListView({
                template: 'attachment-template',
                style: "inset",
                dataSource: new kendo.data.DataSource({
                    type: 'everlive',
                    transport: {
                        typeName: 'dbo_Inspection'
                    },
                    schema: {
                        model: {
                            id: Everlive.idField,
                            fields: {
                                'RiskAssessment': { type: 'number' },
                                'AreaDescription': { type: 'string' },
                                'HasAttachments': { type: 'boolean' },
                                'StatusDescription': { type: 'string' },
                                'CompanyId': { type: 'number' }
                            }
                        }
                    },
                    serverFiltering: true,
                    filter: {
                        logic: "and",
                        filters: [
                            { field: 'CompanyId', operator: 'eq', value: sessionStorage.CompanyId },
                            { field: 'StatusDescription', operator: 'eq', value: 'Open' }
                        ]
                    },
                    serverSorting: true,
                    sort: { field: 'AreaDescription', dir: 'asc' }
                })
            });

    What returns looks like the following:

    attachment-templateattachment-
    templateattachment-templateattachment-
    templateattachment-templateattachment-
    templateattachment-templateattachment-
    templateattachment-templateattachment-
    templateattachment-templateattachment-

    Can I assume I have something wrong with the template and if so could someone point it out.

    Thanks

  2. Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 12 Nov 2015 Link to this post

    Hello Cecil,

     

    the template is specified incorrectly. Please check this demo for the correct syntax.

     

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top