更新された durandal および jquery nuget パッケージを含む Visual Studio 2012 Update 2 hottowel テンプレートを使用しています...
ここに私のコードがあります: Durandal main.js:
require.config({
    paths: { "text": "durandal/amd/text" }
});
define(['durandal/app', 'durandal/viewLocator', 'durandal/viewModelBinder', 'durandal/system', 'durandal/plugins/router', 'services/logger'],
    function (app, viewLocator, viewModelBinder, system, router, logger) {
    // Enable debug message to show in the console 
    system.debug(true);
    app.start().then(function () {
        toastr.options.positionClass = 'toast-bottom-right';
        toastr.options.backgroundpositionClass = 'toast-bottom-right';
        router.handleInvalidRoute = function (route, params) {
            logger.logError('No Route Found', route, 'main', true);
        };
        // When finding a viewmodel module, replace the viewmodel string 
        // with view to find it partner view.
        router.useConvention();
        viewLocator.useConvention();
        // Adapt to touch devices
        app.adaptToDevice();
        kendo.ns = "kendo-";
        viewModelBinder.beforeBind = function (obj, view) {
            kendo.bind(view, obj.viewModel || obj);
        };
        //Show the app by setting the root view model for our application.
        app.setRoot('viewmodels/shell', 'entrance');
    });
});
デュランダル ビューモデル:
define(['services/datacontext', 'durandal/plugins/router'],
    function (datacontext, router) {
        var activate = function () {
            //yes yes - I will separate this out to a datacontext - it is here for debugging simplicity
            var service = $data.initService("https://open.jaystack.net/c72e6c4b-27ba-49bb-9321-e167ed03d00b/6494690e-1d5f-418d-adca-0ac515b7b742/api/mydatabase/");
            //return promise as durandal seems to want...
            return service.then(function (db) {
                vm.set("airports", db.Airport.asKendoDataSource());
            });
        };
        var deactivate = function () {
        };
        var viewAttached = function (view) {
            //kendo.init($("#airportGrid"));
            //kendo.bind(view, vm);
            //kendo.bind($("#airportGrid"), vm);
        };
        var vm = new kendo.data.ObservableObject({
            activate: activate,
            deactivate: deactivate,
            airports: [],
            title: 'Airports',
            viewAttached: viewAttached
        });
        return vm;
    });
デュランダル ビュー:
<section>
    <h2 class="page-title" data-bind="text: title"></h2>
    <div id="airportGrid" data-kendo-role="grid" data-kendo-sortable="true" data-kendo-pageable="true" data-kendo-page-size="25" data-kendo-editable="true" data-kendo-columns='["id", "Abbrev", "Name"]' data-kendo-bind="source: airports"></div>    
</section>
Chrome のネットワーク モニターで jaystack への呼び出しが行われているのがわかります : $inlinecount=allpages&$top=25 そして、データが戻ってきているのがわかります。
kendoui グリッドはうまく作成されていますが、そこにはデータがありません (これは、kendoui が満足しており、MVVM バインディングがバインドされていることを意味すると思いますが、作成された kendoui グリッドは、jaydata から作成された kendoui データソースを理解したくないようです)
デュランダルがなければ、これはhttp://jsfiddle.net/t316/4n62B/29/で示されているようにうまく機能します。
私は2日間試行錯誤してきました-誰かが私を助けてくれますか?
ありがとうTJ