Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript KoGrid不在Durandal JS框架中工作_Javascript_Jquery_Asp.net Mvc_Knockout.js_Durandal - Fatal编程技术网

Javascript KoGrid不在Durandal JS框架中工作

Javascript KoGrid不在Durandal JS框架中工作,javascript,jquery,asp.net-mvc,knockout.js,durandal,Javascript,Jquery,Asp.net Mvc,Knockout.js,Durandal,如何在durandal JS视图页面中绑定koGrid。下面给出的代码不起作用 视图(html) 如果我从浏览器中检查元素,网格将加载其值。我不知道如何清除该问题。有人能帮我吗?项目需要实际返回才能供视图使用,因此: items: ko.observableArray([ { id: 1, name: "abc", price: "asds" }, {id:1,name:"abc",price:"asds"} ]), activate: function () {

如何在durandal JS视图页面中绑定koGrid。下面给出的代码不起作用

视图(html)


如果我从浏览器中检查元素,网格将加载其值。我不知道如何清除该问题。有人能帮我吗?

项目需要实际返回才能供视图使用,因此:

items: ko.observableArray([
       { id: 1, name: "abc", price: "asds" },
       {id:1,name:"abc",price:"asds"}
]),
activate: function () {

}
提示 在执行此操作时,请使用客户端调试器,例如ChromeWeb工具(Chrome中的F12)-这将突出显示“项”无法找到

define([ 'repositories/customerRepository', 'plugins/router', 'plugins/http', 'durandal/app', 'knockout'], function (customerRepository, router, http, app, ko) {
var items = ko.observableArray([
 { id: 1, name: "abc", price: "asds" },
{id:1,name:"abc",price:"asds"},
]);
return {
    router: router,
    items:items, 
    activate: function () {


    },
    attached: function (view) {

    },



};});
items: ko.observableArray([
       { id: 1, name: "abc", price: "asds" },
       {id:1,name:"abc",price:"asds"}
]),
activate: function () {

}