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

dataSource error on SQL View through BackEndServices

1 Answer 59 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Cecil
Top achievements
Rank 1
Cecil asked on 18 Nov 2015, 09:16 PM

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>

1 Answer, 1 is accepted

Sort by
0
Cecil
Top achievements
Rank 1
answered on 19 Nov 2015, 04:25 PM
Nevermind.  Finally found the spelling error!
Tags
Data Source
Asked by
Cecil
Top achievements
Rank 1
Answers by
Cecil
Top achievements
Rank 1
Share this question
or