Javascript 在extjs网格4上显示Json数据

Javascript 在extjs网格4上显示Json数据,javascript,extjs4,Javascript,Extjs4,我正在研究使用json数据在ExtJSGid4上加载数据 App.js中的代码 /* * Ext JS Library 2.0.2 * Copyright(c) 2006-2008, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ Ext.onReady(function () { var proxy = new Ext.data.HttpProxy({ url: 'source.htm' });

我正在研究使用json数据在ExtJSGid4上加载数据

App.js中的代码

/*
* Ext JS Library 2.0.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
* 
* http://extjs.com/license
*/

Ext.onReady(function () {

    var proxy = new Ext.data.HttpProxy({ url: 'source.htm' });
    //Reader
    var reader = new Ext.data.JsonReader(
            {

            }, [
                { name: 'appeId', mapping: 'appeId' },
                { name: 'survId' },                         {name: 'location' },
                { name: 'surveyDate' },
                { name: 'surveyTime' },
                { name: 'inputUserId' }
            ]
        )

    var store = new Ext.data.Store({
        proxy: proxy,
        method: 'POST',
        reader: reader
    });
    store.load();


    // create the grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        columns: [
            { header: "appeId", width: 60, dataIndex: 'appeId', sortable: true },
            { header: "survId", width: 60, dataIndex: 'survId', sortable: true },
            { header: "location", width: 60, dataIndex: 'location', sortable: true },
            { header: "surveyDate", width: 100, dataIndex: 'surveyDate', sortable: true },
            { header: "surveyTime", width: 100, dataIndex: 'surveyTime', sortable: true },
            { header: "inputUserId", width: 80, dataIndex: 'inputUserId', sortable: true }
        ],
        renderTo: 'example-grid',
        width: 540,
        height: 200
    });

});
default.aspx中的代码

    <%@ Page Title="Home Page" Language="C#"  AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="ExtsjControlWithJsonData._Default" %>

<html>
<head>
<title></title>

    <link href="resources/css/ext-all.css" rel="stylesheet" type="text/css" />
    <script src="ext.js" type="text/javascript"></script>
    <script src="examples/init.js" type="text/javascript"></script>
    <script src="examples/shared/examples.js" type="text/javascript"></script>
    <script src="bootstrap.js" type="text/javascript"></script>    
    <script src="App.js" type="text/javascript"></script>

</head>
<body>
<div id="example-grid"></div>

</body>
</html>

但我无法在extjs网格4上加载数据,出现错误:

行:25557

错误:“this.model.prototype”为空或不是对象。我试过了,但运行不正常:“'this.model.prototype'为null或不是对象”。请帮帮我。谢谢更新你的代码,这样我就可以发现问题了。我猜你是在从旧的extjs版本切换到4版本,因为我认为这些类非常不同。。。检查api以获得正确的类和配置。