我在 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);
}
在上面的函数中,我调用所需的 URl 来获取 json as-
{" 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 数据,我想在网格中提供它。但网格不显示任何数据。那么如何将存储数据绑定到网格?我需要做哪些改变?