2010-10-09 61 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來加載本地數據。解決了這個問題。好極了!!