5
我正在使用extjs。我創建視圖,其顯示grid.i創建視圖原樣在extjs中如何將存儲數據綁定到網格
Ext.define('Balaee.view.qb.qbqns.allQuestionPapers' ,
{
extend: 'Ext.grid.Panel',
alias: 'widget.paperlist',
id:'paperId',
store:'QbqnsStore',
border:false,
height:300,
width:450,
columns: [
{
text: 'date',
width: 150,
dataIndex: 'creationTime'
},
{
text: 'QuestionpaperNo',
width: 150,
dataIndex: 'questionPaperNo',
},
{
text: 'Marks',
width:150,
dataIndex: 'obtainMarks'
}
]
});
這個觀點我在getAllPapers按鈕點擊呼叫。所以,我寫的代碼原樣
getAllPapers:function()
{
var getPaperStore=Ext.create('Balaee.store.qb.QbqnsStore');
proxy=reviewQuestionStore.getProxy();
Ext.apply(proxy.api,{
read:'index.php/QuestionBank/qbpaper/getUserAllQuestionPaper',
});
var temp2=Ext.getCmp('QbqnsResultmainId');
temp2.removeAll();
var papers=Ext.create('Balaee.view.qb.qbqns.allQuestionPapers');
temp2.add(papers);
}
在上面的功能我打電話所需的網址,獲取JSON原樣
{" Papers ":[{"questionPaperId":"29","questionPaperNo":"11","userId":"106","allocatedTime":null,"completedTime":"0000-00-00 00:00:00","createDate":"0000-00-00 00:00:00","obtainMarks":null},{"questionPaperId":"30","questionPaperNo":"11","userId":"106","allocatedTime":null,"completedTime":"0000-00-00 00:00:00","createDate":"0000-00-00 00:00:00","obtainMarks":null},{"questionPaperId":"31","questionPaperNo":"11","userId":"106","allocatedTime":null,"completedTime":"0000-00-00 00:00:00","createDate":"0000-00-00 00:00:00","obtainMarks":null}] }
所以現在店裏是有這個上面JSON數據,我想提供它網格視圖。但網格不顯示任何數據。那麼如何將商店數據綁定到網格?我需要做些什麼改變?
有人可以幫我嗎? – user1722857 2013-02-26 12:53:24