2010-10-09 86 views
1

我正在显示一个ExtJS网格。除了在Json商店中关于代理的部分,我得到了一切正确。当我尝试以显示它抛出一个错误: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

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