Data binding Kendo Mobile-MVVM需要帮助将视图模型与数据源绑定

Data binding Kendo Mobile-MVVM需要帮助将视图模型与数据源绑定,data-binding,mvvm,kendo-ui,kendo-mobile,Data Binding,Mvvm,Kendo Ui,Kendo Mobile,我一辈子都搞不清楚这里到底出了什么问题。我试图将视图绑定到视图模型,然后从视图模型中绑定视图中的数据源数组。这是我的密码: HTML: 非常感谢您的帮助 我正在使用Kendo UI Mobile v2013.1.319和JQuery 1.9.1尝试将您的函数更改为使用: homeScreenModel.navicationCategories.fetch() 您能否在JSFiddle/JSBin中发布显示问题的代码,以便我们进行故障排除? <div id="mDashboa

我一辈子都搞不清楚这里到底出了什么问题。我试图将视图绑定到视图模型,然后从视图模型中绑定视图中的数据源数组。这是我的密码:

HTML:

非常感谢您的帮助


我正在使用Kendo UI Mobile v2013.1.319和JQuery 1.9.1

尝试将您的函数更改为使用:
homeScreenModel.navicationCategories.fetch()

您能否在JSFiddle/JSBin中发布显示问题的代码,以便我们进行故障排除?
        <div id="mDashboardView" data-role="view" data-bind="homeScreenModel" data-init="initDefaultView">
            <div data-role="content">
                <div>
                    <div class="m-parent-navigation-container">
                        <section data-bind="source: data" data-template="mDashboardViewTemplate">
                        </section>
                    </div>
                </div>
            </div>
        </div>
<script>
           var homeScreenModel = kendo.observable({
                data: new Array(),
                navigationCategories: new kendo.data.DataSource({
                    transport: {
                        read: {
                            type: "GET",
                            url: "api/GetNavigationData",
                            contentType: "application/json; charset=utf-8",
                            dataType: "json"
                        }
                    },
                    schema: {
                        data: "d.results",
                        model: {
                            fields: {
                                nameOfGroup: { type: "string" }
                            }
                        }
                    },
                    change: function (e) {
                        homeScreenModel.trigger("change", { field: "navigationCategories" });
                    }
                })
            });

function initDefaultView(event) {
    homeScreenModel.navigationCategories.read();
}
</script>
Uncaught TypeError: Cannot read property 'top' of undefined
(anonymous function)