ExtJS网格JSON存储代理错误

时间:2010-10-09 00:11:35

标签: json proxy extjs grid

我正在制作一个ExtJS网格。除了Json商店中有关代理的部分外,我得到了一切正确的信息。当我尝试显示它时会抛出错误:

this.proxy is undefined
Ext.data.Store=function(A){this.data=n...ta=C;this.resumeEvents();return B}});

我发现我需要在商店里做些什么,但不知道是什么。变量列表数据具有Json数组字符串。请任何帮助非常感谢。感谢

var listData = <%= aItems %> ;
var AIGrid;

Ext.onReady(function () {
    var AIRecord = Ext.data.Record.create([{
        name: "ID",
        type: "int",
        mapping: "ID"
    }, {
        name: "WSTITLE",
        type: "string",
        mapping: "WSTITLE"
    }, {
        name: "REQ_ATTUID",
        type: "string",
        mapping: "REQ_ATTUID"
    }, {
        name: "DESCRIPTION",
        type: "string",
        mapping: "DESCRIPTION"
    }, {
        name: "RES_ATTUID",
        type: "string",
        mapping: "RES_ATTUID"
    }, {
        name: "RESOLUTION",
        type: "string",
        mapping: "RESOLUTION"
    }, {
        name: "START_TIME",
        type: "string",
        mapping: "START_TIME"
    }, {
        name: "END_TIME",
        type: "string",
        mapping: "END_TIME"
    }]);

    var AIreader = new Ext.data.JsonReader({
        root: "root",
        id: "ID"
    }, AIRecord);

    var AIstore = new Ext.data.Store({
        nocache: true,
        data: listData,
        reader: AIreader
    });

    var AIcol = new Ext.grid.ColumnModel([{
        header: 'ID',
        readOnly: true,
        dataIndex: 'ID',
        width: 30
    }, {
        header: 'Work Step',
        dataIndex: 'WSTITLE',
        width: 200,
        readOnly: true
    }, {
        header: 'Requester',
        dataIndex: 'REQ_ATTUID',
        width: 80,
        readOnly: true
    }, {
        header: 'Description',
        dataIndex: 'DESCRIPTION',
        width: 300,
        readOnly: true
    }, {
        header: 'Resolver',
        dataIndex: 'RES_ATTUID',
        width: 80,
        readOnly: true
    }, {
        header: 'Resolution',
        dataIndex: 'RESOLUTION',
        width: 300,
        readOnly: true
    }, {
        header: 'Start',
        dataIndex: 'START_TIME',
        width: 100,
        readOnly: true
    }, {
        header: 'End',
        dataIndex: 'END_TIME',
        width: 100,
        readOnly: true
    }]);

    AIcol.defaultSortable = true;

    AIGrid = new Ext.grid.GridPanel({
        store: AIstore,
        renderTo: 'listgrid',
        cm: AIcol,
        enableColLock: true,
        title: 'Open Action Items',
        width: 900,
        height: 500,
        selModel: new Ext.grid.RowSelectionModel({
            singleSelect: true
        })
    });

    AIGrid.store.load();

});

1 个答案:

答案 0 :(得分:1)

我得到了答案。对互联网进行了一些额外的研究。我使用MemoryProxy加载本地数据。这解决了问题。耶!!