This is a migrated thread and some comments may be shown as answers.

Template returns name of template?

1 Answer 56 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Cecil
Top achievements
Rank 1
Cecil asked on 11 Nov 2015, 12:34 AM

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

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 12 Nov 2015, 08:18 AM

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!
 
Tags
Templates
Asked by
Cecil
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or