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

Extracting code to .js file datasource transport read noch triggered

1 Answer 18 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Boas
Top achievements
Rank 1
Boas asked on 13 Sep 2012, 10:28 AM
Hi after I extracted my code from a asp.mvc site to an explicit js file
the grid doesn't load the data.

The grid is executed and the script runs, but it seems like the grid never triggers the read function

Am I doing something wrong?
here my js code

integration of the js file
<script src="~/Scripts/Domain/Inbox.js"></script>


Js File itself:
/// <reference path="../Kendo/kendo.all-vsdoc.js" />
function onSelectionChanged(e) {
    var selected = this.select();
    
    selected.data("Subject");
    $('#memo').append(selected.field);

}

$(document).ready(function () {
    var apiUrl = '@(Url.RouteUrl("DefaultApi", new { httproute = "", controller = "nbox" }))';

    $("#inboxGrid").kendoGrid({
        dataSource:
            {
                transport: { read: apiUrl },
                pageSize: 10
            },
        columns: [
            { title: "Sendedatum", field: "SentDate", filterable: true, sortable: true, format: "{0:dd.MM.yy}" },
            { title: "Subject", field: "Subject", filterable: true, sortable: false }
        ],
  
    });


});

1 Answer, 1 is accepted

Sort by
0
Boas
Top achievements
Rank 1
answered on 13 Sep 2012, 10:54 AM
Sorry my fault, i used mvc razor syntac in the js file, which doesn't work there ;-)
Tags
Grid
Asked by
Boas
Top achievements
Rank 1
Answers by
Boas
Top achievements
Rank 1
Share this question
or