我有一个由文本框、按钮和 ListView 组成的面板。我相信我已经正确设置了这个列表,但列表除外。Listview 不显示来自商店的数据。请帮助我尝试添加如下:
Ext.define('Abc.view.Trains', {
extend: 'Ext.Panel',
xtype:'searchtrains',
requires: [ 'Ext.dataview.List','Ext.Label','Ext.form.FieldSet'
'Abc.view.SearchTrainResults','Abc.view.SampleList'],
config: {
title: 'Train Enquiry',
items: [
{
xtype: 'fieldset',
style:'width:74%; float:left',
margin:'10px',
items:
{
xtype: 'textfield',
placeHolder: 'Username',
itemId: 'trainNoTextField',
name: 'trainNoTextField',
required: true
}
},
{
xtype: 'button',
itemId: 'trainSearchButton',
ui: 'action',
padding: '10px',
text: 'Go',
style:'width:20%; margin-top:10px; float:right'
},
{
xtype: 'sampList',
}
]
]};
Abc/view/SampleList
Ext.define('Abc.view.SampleList', {
extend: 'Ext.List',
xtype: 'sampList',
requires: ['TrainEnquiry.store.SampleList'],
config: {
title: 'Train Enquiry',
itemTpl: '<div class="myContent">'+
'<div><b>{status}</b> </div>' +
'</div>',
store: 'SampleList',
},
});
Abc/商店/SampleList
Ext.define('Abc.store.SampleList', {
extend: 'Ext.data.Store',
config: {
fields: ['status'],
data: [
{ status: "Live! Train Statusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg" },
{ status: "Live! Station Statustusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg" },
{ status: "Train Time Tabletusjhgkbvdsbvfbnsdfvsdgfjasdgjhagsdhjasgdahjsgdjhasdbahjsgdsajhdgahjsgdashdgajhsdgajhsdvahjsdg"}
]
}
});