dataSource error on SQL View through BackEndServices

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

    Posted 18 Nov 2015 Link to this post

    I have a View in my SQL database defined in BackEndServices for my project.

    When the following view runs, I get an "Uncaught TypeError: undefined is not a function" with my datasource.

    Any thoughts?

    <div data-role="view" data-title="TheTest" data-layout="main" data-show="onShow">
     
        <!--Page Title-->
        <div data-bind="html: title" class="pagetitle">INSPECTIONS</div>
     
        <!--ListView Headings-->
        <div>
            <table>
                <tr>
                    <td style="width: 50%">
                        NAME
                    </td>
                    <td style="width: 50%">
                        DATE UPLOADED
                    </td>
                </tr>
            </table>
        </div>
     
        <!--List of Inspections for the company-->
        <div><ul id="attachmentList"></ul></div>
     
    </div>
     
    <script>
     
        // attachments DataSource
        var attachments = new kendo.data.dataSource({
            type: 'everlive',
            transport: {
                typeName: 'dbo_View_InspectionAttachments'
            },
            schema: {
                model: {
                    fields: {
                        'Id': { type: 'number' },
                        'fileName': { type: 'string' },
                        'dateuploaded': { type: 'date' }
                    }
                }
            },
            serverFiltering: true,
            filter: {
                logic: "and",
                filters: [
                    { field: 'inspectionid', operator: 'eq', value: 8385 },
                    { field: 'confidential', operator: 'eq', value: false }
                ]
            },
            serverSorting: true,
            sort: { field: 'fileName', dir: 'asc' }
        });
     
    </script>
     
    <script>
        function onShow(e) {
     
            //Find the attachment listview
            var attachList = e.view.content.find("#attachmentList");
     
            // Passing template, datasource, and style to Attachment listview
            attachList.kendoListView({
                template: "<div><table><tr><td style='width: 50%'><label>#: fileName #</label></td>" +
                    "<td style='width: 50%'><label>#: dateuploaded #</label></td></tr></table></div>",
                style: "inset",
                dataSource: attachments
            });
        }
    </script>

  2. Cecil
    Cecil avatar
    15 posts
    Member since:
    Dec 2011

    Posted 19 Nov 2015 in reply to Cecil Link to this post

    Nevermind.  Finally found the spelling error!
  3. Kendo UI is VS 2017 Ready
Back to Top