Extracting code to .js file datasource transport read noch triggered

2 posts, 0 answers
  1. Boas
    Boas avatar
    9 posts
    Member since:
    Sep 2008

    Posted 13 Sep 2012 Link to this post

    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 }
            ],
      
        });


    });

  2. Boas
    Boas avatar
    9 posts
    Member since:
    Sep 2008

    Posted 13 Sep 2012 Link to this post

    Sorry my fault, i used mvc razor syntac in the js file, which doesn't work there ;-)
  3. Kendo UI is VS 2017 Ready
Back to Top